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?
Facebook developers can sometimes outperform Google developers, although the comparison has a lot of extaneous variables here :)