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.
Leave a Reply