Facebook's HipHop - What's it for?

facebook, hiphop, php

Solution

Web applications that do a lot of processing and/or use a lot of memory. Apparently this HipHop will reduce CPU usage by around 50% and also reduce memory usage (I didn't see how much the memory usage would be reduced by mentioned anywhere). This means that you should be able to serve the same number of requests with fewer servers.

An added benefit may be that there will be some basic type checking to ensure that the code is consistent before it is compiled. This should help to locate the type of bugs that PHP currently tends to ignore as a result of its weak type system.

The downside appears to be that it might not support some of PHP's more dynamic features such as `eval` (though arguably that's a positive too).

Problem

The news in the PHP world today is Facebook's HipHop, which: 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. My question is, what type of web applications is this actually useful for? Seems like typical database-bound web apps may not be greatly served by this, but rarer CPU-bound apps would.

Original source