Facebook’s HipHop for PHP will make your website dance
PHP has been facing the music for quite a while now, but nothing like this! The developers at FaceBook, the most popular social networking site in the world, are perhaps in the best position to test the limits of PHP, and that is exactly what they are doing.
As their latest open source release, FaceBook brings to you HipHop for PHP. A new way to improve the performance of PHP applications by compiling PHP code — indirectly.
PHP is one of the most popular server side scripting languages for creating web applications, however that has not absolved it of its performance issues. To a website like FaceBook performance issues are especially important as even a 1 per cent performance gain can lead to great savings.
Their latest release tackles these performance concerns by converting your PHP code to native C code such that it can be compiled and run with much decreased resource usage. For their own server, they have witnessed 50% lesser CPU usage, while the API gains by up to 30%. In this source code transformation process, some of the lesser used features of PHP are sacrificed — a special mention is theeval() function — in order to enable this performance gain.
FaceBook will release not only the HipHop code transformer, but also rewrites of some of the most commonly used PHP extensions to make better use of the performance gains.
While it is possible to just do your application in C , as Haiping Zhao, the developer of this project explains, this just makes you code less accessible as there are fewer web developers who can work on the application as a whole.
As he goes on to say, many measures to improve PHP’s performance have appeared over time, which involve optimization of PHP internals and optimization, however compiling it to C itself means you can get native performance.
As a majority of websites today are built on PHP, this project is quite good news indeed. With a simple open source project one can now improve the performance of web applications, save money, and energy.
The name of the project itself is a little too odd to bear. HipHop for PHP? It’s going to be a hard sell for any web developer to propose that their clients use HipHop to improve the performance of their website!
More about HipHop for PHP at the FaceBook developer blog.