Laying down some PHPat beats
If there has been one buzz in the past days, it's been the announcement of Facebook of the Hip Hop for PHP (or HPHP). This new tool for PHP developers (or actually for users of PHP) is aimed at gaining performance by converting PHP code to C++ code, then compiling the C++ code to a binary which includes a web server. But what will it actually mean for PHP?
Over the years there's been a lot of tools to improve the performance of PHP. Sometimes, these were tools specifically aimed at PHP (such as APC or the Zend Optimizer), at other times we've been hooking into existing tools (such as Memcache). But in all these situations, the actual PHP code was left alone and deployed in the traditional way of putting the PHP files on a server that is able to parse the PHP files on each request. There have been other initiatives to compile PHP (such as
Roadsend) but for some reason there was no big adoption. I think this might change with HipHop for PHP.
One reason for things like RoadSend not to get a huge adoption figure is obviously because it requires a lot of control over the server you deploy to. And since the majority of PHP users deploy to shared servers with limited control over their server, there is little that can be done to actually use it. Another reason though is because most probably many people did not know about Roadsend and similar initiatives. Even in the larger companies that I've worked for in the past, I've never really encountered it so far, and it wasn't until recently that I bumped into Roadsend.
But with the rise of Virtual Private Servers and the dropping prices of dedicated servers, more and more people are taking control over the environment to which they deploy their PHP applications, whether business or private. And with that, initiatives such as Roadsend and HipHop for PHP get more leverage. And actually they become more useful, because in a VPS, every little bit of resource counts, so when there are tools that can save some resources, people are more inclined to start using it.
Still, HipHop for PHP might not be for everyone. First of all, because not every PHP application will be able to use it (HipHop for PHP can not convert all PHP to C++ code. Things such as eval() won't work). But also, because it won't be necessary for everyone. If you're just running your personal blog, I'm not sure HipHop for PHP will be for you. It might be able to help, but with a regular blog the difference might not be so big, especially given the hassle it will take to use it. Keep in mind that you've have to convert, compile and deploy for every little change to your script.
So where can it be really useful then? I foresee a lot of use for HipHop for PHP in PHP-based backends. PHP applications that have a multi-tiered architecture can benefit from HipHop for PHP. The front-end could be a pure PHP implementation. This makes it easy to change the front-end. The back-end services on the other hand could be HipHop for PHP services that expose data and/or contain the business logic. This is the part of the application that doesn't change as much as the front-end, so the overhead of converting and compiling is more worth it. And this is also the place where big performance hits are usually taken, making it even more interesting to speed up that part of an application.
It might even be that, with the above in mind, more people will go for a more service oriented approach to their application, finding out performance bottlenecks in their application, converting them to isolated components and turning those into HipHop services.
And this is where I hope HipHop for PHP will help PHP development in general, even for those that will not actually use it: It might make people give more thought on architecture, on nice and isolated components that can be easily replaced or refactored without having to change the whole application. Even when people end up not using HipHop for PHP, the fact that it is available and people know about it may make people consider their application architecture.
Now it's just waiting for the sources to become available, so that everyone can start playing with it.
February 3, 2010 - tags: php, hiphop, facebook, performance
Joshua Thijssen: Although I support every project that speeds up the execution of PHP, i'm not 100% sure that it will be *THE* magic bullet the php community is waiting on.
The bottleneck in most PHP applications would be I/O and other external factors. For instance: I/O of the webserver sending or receiving http requests, waiting for database or memcache results etc. In general: your systems will be waiting on IO or blocking system calls rather then bottle-necking on the PHP/zend engine to do it's stuff.
However, I really do like to see some benchmarks on the average performance gain.
left: Joshua: I'm not saying it's the magic bullet. Much on the contrary, I do not think this will help the majority of PHP developers. I do think it could be a good step towards better and faster PHP applications by having people consider more factors than the historical factors.
Clarian: I agree with Left. It seems fast and convenient, but it's not the final chapter in the PHP evolution. It only helps a small window of PHP developers and may even throw your average PHP user off balance. I've been using it for awhile and it's definitely an upgrade, but just not a big enough one. I do look forward to what might be next though. Assuming it hasn't already happened...I'm behind the trends sometimes.
-J. Clarian
Orlando Managed services: I use php all the time at work. There is nothing better for building websites. there is nothing better.
Wound Bandages: I really like the work that has gone into making the post. I will be sure to tell my blog buddies about your content keep up the good work. Thanks
Diamond Sofa: I love this post a lot. I'll definitely be back again. Hope that I will be able to study far more informative posts then. Is going to be sharing your wisdom with all of my associates!
ashley furniture: I wanted to thank you for this great read!! I undoubtedly having fun with each little bit of it I've you bookmarked to check out new stuff you post
Robert Michael Furniture : Thanks for your sharing .Your thoughts are creative and they actually do help to me. It provides me with a lot of information. It is a nice post!
offset patio umbrella:
Great blog article about this topic,I have been lately in your blog once or twice now.I just
wanted to say hi and show my thanks for the information provided.
Time Warner Bundles: This is definitely a blog worth following. You’ve got a great deal to say about this subject, and so much knowledge. I think that you know how to make people listen to what you have to say, especially with an issue that’s so important. I am glad to see this blog. Two big thumbs up, man
tilting patio umbrella: I cant believe the amount of fantastic info you have on your weblog. I've learned a lot from it. Will probably be coming back soon...
vinyl siding price: Thanks for the info about the new PHP hiphop development, keen to see how it performs.
love facebook statuses: You’ve got a great deal to say about this subject, and so much knowledge. I think that you know how to make people listen to what you have to say, especially with an issue that’s so important. I am glad to see this blog. Two big thumbs up, man
facebook status: more people will go for a more service oriented approach to their application, finding out performance bottlenecks in their application, converting them to isolated components and turning those into HipHop services.
timeline profile covers: This seems to be a good news. I will use it for my site.
China Wholesale: I wanted to thank you for this great read!! I undoubtedly having fun with each little bit of it I've you bookmarked to check out new stuff you post
Nike Free 3.0 V4: Im quite certain I'll learn a lot of new stuff right here! Best of luck for the next!