Jump to content
xisto Community
Sign in to follow this  
BuffaloHelp

Hiphop Rewrites Php Runtime As Much As 50% Reduction In Cpu Usage and you wont believe who wrote it

Recommended Posts

Complete Open source called HipHop transforms PHP codes to run like a compiled C++ executable. Called the source code transformer, HipHop keeps the best aspects of PHP while taking advantage of the performance of C++ by optimizing and compiled using g++.

And who would come up with this new runtime method? Facebook, of course! Using HipHop, the Facebook web server CPU usage has been decreased by about 50% percent. This means less time upgrading in hardware, expensive servers and overheads like Google and Yahoo who have thousands of servers to run their operation. If one server can handle as two because of HipHop, it's just amazing to know how much they can cut down in maintenance and energy consumption. And that's all good for us because it helps us by conserving and reusing.

More read on how HipHop works, check this article

Can we get it on our hosting, OpaQue? :)

Share this post


Link to post
Share on other sites

The reason HipHop is good for Facebook is that they have (probably) optimized the hell out of every other shred of their code, to the point where they simply couldn't find any more substantial performance gains. For 99.99% of the sites on the internet, that's not the case.

For most web apps, the performance bottleneck is the database -- inefficient queries can absolutely cripple a site. If the queries are optimized, then you profile your PHP code and make sure you weed out any inefficiencies in there. You also need to make sure you're efficiently delivering files to the browser: css sprites for images, gzipping/minifying/compressing javascript, condensing css files, etc.

Once all that is done, you implement opcode caching and other easy-to-use server-side optimization: APC or eAccelerator, Zend Server, memcached, etc.

Until you've done all of that (at bare minimum), you shouldn't even begin to THINK about using HipHop. However, for large, high-traffic sites that have maxed out traditional optimization options, HipHop seems to be a really great solution with possible game-changing implications.

I'm surprised about another Facebook PHP project, XHProf:
http://forums.xisto.com/no_longer_exists/

XDebug is a massive system with a lot of functionality, and I've found it too heavyweight when I just need to do some simple profiling. You have to load your trace files into a separate profile viewer for example, which is a massive pain if you're running you code on a remote server without a GUI.

XHProf is a much simpler extension that gives you instant web-viewable results. It doesn't go into as much depth as XDebug, but it's perfect for debugging 95% of my speed problems.

It's just a shame XHProf doesn't have the sexiness of a brand new runtime, it's far less well-known.

Share this post


Link to post
Share on other sites

Hi!@deadmad7As someone who runs a pretty active WordPress based blog, I believe the key issue with most PHP based content management systems and blogging engines most definitely lies in PHP's ability to hog the CPU. Cutting that down by as much as 50% is definitely a huge plus. Sure, there's caching but there's only so much that you can do with caching before you realize that it increases your development time and holds you back in terms of the features that you want to develop.Right now, after the upgrade to the Xisto forums, the IPBoard is quite slow and it could possibly be due to the CPU. In fact, I would not be too surprised if the slowdown is due to the excessive CPU usage.Using HipHop or Phalanger or a similar solution would help in reduce the CPU requirements of the PHP scripts and would enable execution of high-traffic PHP-based websites on modest hardware. Custom-built PHP scripts often have minimal CPU requirements, but when you add in theming and a plugin framework, that's where you have a truly extensible project... using it with a heavy traffic load is bound to send your CPU requirements sky high! (...which reminds me, we did have a member here named Sky, didn't we?)Combining the use of Phalanger and HipHop with a build script would be apt because between converting PHP source code into Java byte code, Microsoft .NET Intermediate Language, and C/C++ source code, we don't really need to look at the code for debugging, unless we are debugging Phalanger or HipHop.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.