Summary of HipHop PHP and You

Unless you have been under a rock, out in the wild trying to find yourself or too enthralled with the fact that Lost is back, then you’ve heard of HipHop PHP.  The twitterverse and blogs have been exploding with what they think of HipHop PHP.

For all of you who haven’t really heard, HipHop was created by Facebook to help them scale…I guess they have a lot of users or something.  Essentially HipHop compiles/translates PHP (script language) into compiled C++.  This makes good speed improvements, decreasing CPU usage.  As a lot of other developers have mentioned, this seems really cool and beneficial.

Simply, this benefits maybe 10% of PHP sites.  High traffic sites with load balanced servers…etc…etc..will benefit most.  I’d say the majority of PHP sites are utilizing drupal, wordpress or joomla.

How does this effect the other 90% of sites?
Just because you see these great stats doesn’t mean you need to go jump on the HipHop bandwagon.  The worst thing you can do is overcomplicate things, well maybe not the worst.  I will provide you with the list of things you need to do before you even consider using HipHop PHP:

  1. Find Your Bottleneck: If you tell me your site is slow, the first thing I’m checking is your database.
  2. Limit Your Database Calls
  3. Budget Your “Cache”: APC is a bytecode optimizer that will save you so much headache, and needless DB calls.  Also, look into memcached.
  4. Framework Hell: Many new developers find themselves here.  With all these “automagic” features it is hard not to end up there.  Don’t get too trigger happy with your autoloader.
  5. HTTP Requests: Listen to Yslow and cut back on your HTTP requests.  Utilize a CDN if necessary.
  6. Write C Extension: If you or the people you work with know C, then invest the time in writing your own C extension.  * A big reason for HipHop was the already huge codebase. *

Before I end this post and get bashed for hating on HipHop, please read.  I do not think HipHop is bad.  I think a lot of people who claim they need HipHop haven’t done their research or asked the right questions.  IF PHP IS YOUR BOTTLENECK THIS MAY BE YOUR ANSWER!

Here are what many great minds in PHP have to say about HipHop: http://www.phpdeveloper.org/news/13958

* Notes: Anyone think there will be debugging issues with it being Compiled? *

Leave a Reply

Spam Protection by WP-SpamFree