Linked by David Adams on Wed 14th Dec 2011 16:01 UTC, submitted by fran
Internet & Networking PHP's popularity and simplicity made it easy for the company's developers to quickly build new features. But PHP's (lack of) performance makes scaling Facebook's site to handle hundreds of billions of page views a month problematic, so Facebook has made big investments in making it leaner and faster. The latest product of those efforts is the HipHop VM (HHVM), a PHP virtual machine that significantly boosts performance of dynamic pages . And Facebook is sharing it with the world as open-source.
Permalink for comment 500237
To read all comments associated with this story, please click here.
RE: Waittaminute...
by ggiunta on Fri 16th Dec 2011 00:03 UTC in reply to "Waittaminute..."
ggiunta
Member since:
2006-01-13

You should read it again a bit better, I think ;-)

FB developed a PHP compiler a while ago, called hiphop/hphpc (as in, turn php code to c++ then just compile it to native).
The code it produces is -already- faster than the interpreted bytecode by the php engine, but, to the surprise of many people, not so much. In part because the usual php web page does not do a lot of calculations, of course. Where the hiphop compiler really shines though, is in reducing cpu and memory used to render the same webpages - and that is very important to FB. It is a good thing for any website owner, but the cost involved in using the static compiler (loss in dev productivity and deployment ease) do not generally compensate the gain.

They also developed an alternative php interpreter, called hphpi, which was closer to the hiphop compiler in its syntax support, but way too slow for real life usage. That's why they use it for development only. The interpreter evolved over time, but it is probably still worse than plain php (http://en-gb.facebook.com/notes/facebook-engineering/making-hphpi-f... - I think some of those optimizations have been part of php for a while), without even taking apc into account...

The "yet another alternative php interpreter, called hhvm" they announce might be slower than the php engine today, but it still has an edge: jit to native code. And, by virtue of that, and possibly using profile-guided optimization, they hope for hhvm to produce the fastest running code in the future.

While I'm no fan of fragmenting oss projects, I have always thought that alternative php implementations were a good idea, if nothing else to give some competition to the php-vm developers and to prove that the language is derived from a real spec and can be reimplemented.

Now, figures of hphpc or hhvm vs php+apc would be interesting.
And of course figures from parrot, if only its php support was in a decent state...

Reply Parent Score: 2