3 ms·
Actually with HHVM, PHP is faster than Node.js! Facebook developers can sometimes outperform Google developers, although the comparison has a lot of extaneous
by EGreg 13y ago
Actually with HHVM, PHP is faster than Node.js!
Facebook developers can sometimes outperform Google developers, although the comparison has a lot of extaneous variables here :)
- frik 13y agoTrue, and HHVM is awesome. Where Node.js shines is Web Sockets and similar things. But one can use libevent with PHP (though not as easy). I found some useful comparision benchmarks on that site: http://www.techempower.com/benchmarks/#section=data-r9&hw=i7&test=query http://www.techempower.com/benchmarks/#section=data-r9&hw=i7...
- EGreg 13y agoDo you know of a way to use libevent to make concurrent queries to mysql? Or mysqli to do this? I mean hitting MULTIPLE database servers / shards. That would speed up my php by a lot. I an cache results of queries in PHP but can't batch things together before they are sent. In JS I can wait for 50msec to do requests in batches. That lets higher lawyers (ViewModels) query the model without worrying about batching!
- frik 13y agoIO related PHP API are a problem, one needs non-blocking functions for optimal performance. Sorry, as HHVM doesn't expose libevent yet (at least last asked the devs on IRC), I moved some portions of my code to node.js for now. (plus HHVM relies itself on the older libevent 1.4, instead of the 2.x that PHP exposes as API) I would be interested in the answer too. Maybe ask it on stackoverflow.com or so?