HipHop for PHP, The PHP Compiler by Facebook

Posted February 2 by Dan Cryer

PHP LogoFacebook have just announced the release of their new PHP compiler, HipHop for PHP. News of the compiler was leaked in an interview on The Rumpus in mid january, and expanded upon by Read Write Web earlier this week. That, combined with members of the PHP core development team being invited to the Facebook headquarters yesterday, this announcement comes as very little surprise.

The announcement states that running HipHop has reduced the CPU footprint of the Facebook code base by 50%, over using the standard PHP runtime. Whilst those improvements may not be reflected by all PHP applications, due to the special nature of the Facebook codebase, it represents an undeniably vast improvement to what was previously an engine known for being somewhat hacked together.

As the improved engine is seemingly so much more efficient, I assume a significant portion of the PHP developer community will now start tinkering with HipHop for PHP and the crazier amongst us will start making the switch over on our personal sites and projects. This is going to have a huge impact on the PHP community, web hosting industry and those who work in either. I can only assume that some hosts are already receiving their first “When will we get HipHop for PHP?” emails.

I’m going to set it up on a sub-domain of this site when it’s released this evening, assuming it can run under Apache at the moment, and see how much it affects performance running simple web sites powered by software like Wordpress and IP.Board. If it is compatible and makes much of a performance difference, I’ll switch the whole server over here, and start looking at it more seriously for our systems at work.

For more information, see the official announcement by Facebook.

One Response to “HipHop for PHP, The PHP Compiler by Facebook”

  1. Ben Davies says:

    From what I’ve read, it looks like HipHop compiles a subset of PHP to C++, which can be compiled to an executable. The executable contains a Web Server, so the resulting code is not used with any existing web server framework (so things like web server based authentication etc etc might be an issue). On top of this, the subset of PHP it supports may be an issue for some (they currently only cite eval() as an example, but it might be more). They also not that SOME PHP modules have been converted to run, so any non-converted modules that a script use would rule out the script from compilation.

    On the basis of this, I think there will be exactly zero hosting companies providing hiphop support or compilation. Try getting a hosting company to run your own compiled cgi or apache module. They (sensibly) wont.

    I think hiphop is interesting, but has very specific, niche case uses. like, cpu-bound scaling issues specific.

    Cool tech though :)

Leave a Reply