Search This Blog

Tuesday, February 02, 2010

HipHop for PHP: Move Fast

With HipHop we've reduced the CPU usage on our Web servers on average by about fifty percent, depending on the page. Less CPU means fewer servers, which means less overhead.
HipHop for PHP isn't technically a compiler itself. Rather it is a source code transformer. HipHop programmatically transforms your PHP source code into highly optimized C++ and then uses g++ to compile it. HipHop executes the source code in a semantically equivalent manner and sacrifices some rarely used features - such as eval() - in exchange for improved performance. HipHop includes a code transformer, a reimplementation of PHP's runtime system, and a rewrite of many common PHP Extensions to take advantage of these performance optimizations.

Interesting thing to observe here is that people find it less expensive (and quicker) to develope applications in 'simple' languages like PHP. For speed, rather than (mannually) porting application code which is expensive in terms of time and money (and also error prone), people prefer to change the runtimes, use automated porting (HipHop style) or even throw more hardware at it.

Slash doted at

"As expected, Facebook today announced a new runtime for PHP, called HipHop. What wasn't expected were a few key revelationsdisclosed today by Facebook developer David Recordan. As it turns out Facebook has been running HipHop for months and it now power 90 percent of their servers - it's not a skunkworks project it's a Live production technology. It's also not just a runtime, it's also a new webserver. 'In general, Apache is a great Web server, but when we were looking at how we get the next half percent or percent of performance, we didn't need all the features that Apache offers," Recordon said. He added, however, that he hopes an open source project will one day emerge around making HipHop work with Apache Web servers.'"

Previous related news:

It would be interesting to see it's made available in open-source and can be applied to drupal.

<from slashdot>
Facebook has gotten fed up with the speed of PHP. The company has been working on a skunkworks project to rewrite the PHP runtime, and on Tuesday of this week, they will be announcing the availability of their new PHP runtime as an open source project. The rumor around this began last week when the Facebook team invited some of the core PHP contributors to their campus to discuss some new open source project.
</from slashdot>

Slash doted at

No comments: