Hacker News new | ask | show | jobs
by frik 4419 days ago
True, 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...

1 comments

Do 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!

IO 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?