Update: with the release of HHVM 2.0 the below becomes entirely obsolete. Cheers!
Yes, it finally happened – Facebook announced the PHP to C++ translator. Hurray!
So, after reading the post I can assume it:
- parses PHP code,
- extracts PHP AST,
- converts to C++ AST and
- generates C++ code.
Honestly, it’s not the best way of optimization, but probably is a quick win (BTW, why did it take for them so long?), which theoretically might indeed generate efficient C++ code.
But wait, what do they report? “We’ve reduced the CPU usage on our Web servers on average by about1 fifty percent3, depending on the page2.”
I have some doubts:
- Where is the objective and comparative statistics?
- Did they even collect the general statistics, or just tested some pages to see the difference?
- 50%? That’s it? And how about the fact that C++ is actually 3-500 times faster (also here) (That would be 70% to 99% reduce of CPU). In fact the well known PHP Accelerators provide the same level of performance improvement as HipHop! It’s interesting, did they try any of them before entering the so called “Hackathon”.
In addition to reflections above, looking at the profiles of 2.5 coders which hacked the translator, I sorrowfully tend to estimate that the answer for the question in this Post’s subject is positive. Nevertheless I’m full of sincere hope that further info will dispel my suspects and prove that HipHop is actually a brilliant peace of software.