Forum Moderators: coopster

Message Too Old, No Replies

Facebook release HipHop for PHP

"With HipHop we've reduced on our Web servers by 50%"

         

gethan

4:40 am on Feb 3, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



FaceBook Developers Release [developers.facebook.com]

Some interesting quotes from the release;

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.


...it's been challenging to scale Facebook to over 400 billion PHP-based page views every month.



One thing that strikes me immediately is that HipHop does exclude some PHP features (eval being one I do use), and will require a more complex release strategy.

I'd like to know it's performance improvements over other "pre-compilers" such as zend and eAccelerator.

Is the quoted 50% improvement over un-optimised un-pre-compiled code?

jatar_k

3:06 pm on Feb 4, 2010 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



>> Overall HipHop allows us to keep the best aspects of PHP while taking advantage of the performance benefits of C++.

very very cool

I think this explains it best from what's there
1. Static analysis where we collect information on who declares what and dependencies,
2. Type inference where we choose the most specific type between C++ scalars, String, Array, classes, Object, and Variant, and
3. Code generation which for the most part is a direct correspondence from PHP statements and expressions to C++ statements and expressions.

IanKelley

1:27 am on Feb 7, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Very cool indeed. Now I can stop debating whether to start writing web apps in C++ for performance reasons :-)