Benchmark of PHP Branches 3.0 through 5.3-CVS

Benchmark of PHP Branches 3.0 through 5.3-CVS

As people keep asking me for an update to my previous benchmarks (PHP / GCC / ICC Benchmark, PHP 5.1 / GCC Benchmark (Update), and PHP 5.1 Performance, I quickly ran a new benchmark today.

The image above shows a stacked Bar Chart rendered using the Cairo backend of the Graph eZ Component of benchmark data from the 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).
Benchmark of PHP Branches 4.3 through 5.3-CVS
  • 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.
Benchmark of PHP Branches 5.1 through 5.3-CVS
  • 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.