Monday, March 08, 2010

Facebook – HipHop

Opensource project that allows us to transform the PHP code to optimized C++ code and compiles the code to native platform. It has reduced CPU and memory usage and allowing better scalability.

Following the path of APC and eAccelerator but little beyond that.


dEEPS said...

From my tests, I can say that APC sucks, eAccelerator rules as a opcode cache.

Why? Read on.

Cache updation policy can be one of the below:

1) For each request, let the caching solution check each time whether a PHP file has been updated by checking the modified time, so that it can be re-cached if newer
2) Let the caching solution not check.. we can clear the cache manually everytime we release any new file

For #1, OS had to do a stat on each PHP file that has to be parsed to build the page.. this is chaotic for larger projects with 100s of PHP files, degrades performance bigtime.

Both APC & eAccelerator supports switching off the stat-business so that we can do #2.

However, in the case of APC, #2 works only if you have provided absolute paths in all your require_once and include methods.

Even if our own code is refactored to have absolute paths, we never know if all the libraries and tools we have included in our project are compliant.

Therefore, eAccelerator rules (for now.. Rasmus is working on APC for PHP 6, so he is gonna fix it!)