Benchmark of PHP Branches 3.0 through 5.3-CVS
- We can clearly see that the introduction of bytecode generation/interpretation in PHP 4 gave a huge performance boost (PHP 4 is 6.5 times faster than PHP 3 for raw execution speed).
- The focus of PHP 5.0 was on features, not performance.
- The focus of PHP 5.1 was on performance and the new executer delivered on its promise (PHP 5.1 is 2.5 times faster than PHP 4.4 and PHP 5.0 for raw execution speed).
- The focus of PHP 5.2 was on stability.
- PHP 5.3 brings new features (namespaces, late statics binding, and the garbage collector, for instance) but the refactoring of the argument stack, for example, and other optimization patches have lead to a measurable performance improvement (PHP 5.3 is 1.2 times faster than PHP 5.2 for raw execution speed).
A modified version of the
Zend/bench.php that is compatible with earlier versions of PHP has been used during the benchmark.
The PHP binaries were compiled using
gcc (GCC) 4.2.3 (Ubuntu 4.2.3-1ubuntu1) and
CFLAGS="-march=native -mtune=native -O2 -pipe" on an IBM ThinkPad X60s with an Intel Core Duo L2400 CPU running Linux 2.6.24-5-generic (Ubuntu Hardy Heron).
The extended body of this blog entry contains the raw benchmark data.