Facebook : Some HipHop to speed up PHP

February 04th, 2010 - 10:25 am ET by J. G.

Developed by the Facebook teams, HipHop for PHP is an open project to convert PHP code to C++.

HipHop_logoPHP is a web language executed on the server side. Widely used on the web due to its simplicity, this scripting language is showing certain limitations, restricting how effective it can be on Web server CPU’s. This is what Haiping Zhao points out, a Facebook engineer who has presented a tool developed in secret over the last two years.

HipHop for PHP is a source code translator that is capable of converting PHP into optimised C++. Zhao states that this isn’t a compiler, with the load instead being left to the GNU g++. The conversion is done semantically, although the optimisation can lead to some PHP functions being sacrificed, even if this has been stated as being a "rare" occurrence.

With HipHop, Facebook will reduce the load on their web server’s CPU’s by an average of 50%. The deployment of HipHop on Facebook started six months ago with 90% of their web traffic being affected by this new system. The social network displays more than 400 billion PHP based pages each month.

The HipHop project is open source. It is hosted by its own Web server, which means that it is incompatible with Apache. As a beta version, HipHop handles PHP 5.2, with improvements to be made once PHP 5.3 is supported.

HipHop has been put online at GitHub. For web developers, more details can be found at this Facebook release, where you will also receive information about other PHP improvement methods provided.

Post a comment
Previous news Next news
Internet Explorer : Microsoft announces a new fault Cyber attacks : Google enlists the help of the NSA