Benchmark of PHP Branches 3.0 through 5.3-CVS

Sebastian Bergmann » 07 February 2008 » in Benchmarks » 3 Comments

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.

                   PHP 3.0.18   PHP 4.3.11   PHP 4.4.7    PHP 5.0.5    PHP 5.1.6    PHP 5.2.5    PHP_5_3
--------------------------------------------------------------------------------------------------------
simple               7.958       1.630        1.611        1.351        0.453        0.416       0.382
simplecall           5.044       0.836        0.828        0.804        0.502        0.496       0.456
simpleucall          6.252       1.207        1.151        1.140        0.790        0.794       0.750
simpleudcall         6.267       1.367        1.329        1.259        0.898        0.919       0.771
mandel              26.184       6.454        6.234        5.536        1.268        1.265       1.016
mandel2             32.621       6.816        6.618        5.778        1.617        1.594       1.267
ary(50000)           0.666       0.146        0.144        0.134        0.066        0.057       0.053
ary2(50000)          0.420       0.123        0.122        0.121        0.060        0.044       0.043
ary3(2000)          13.224       2.301        2.288        1.992        0.671        0.630       0.556
fibo(30)            18.732       3.549        3.507        3.312        2.265        2.334       1.908
hash1(50000)         0.826       0.192        0.189        0.177        0.104        0.097       0.089
heapsort(20000)      1.839       1.106        1.097        1.009        0.331        0.334       0.286
matrix(20)           5.008       1.071        1.075        0.963        0.289        0.296       0.293
nestedloop(12)      14.304       2.346        2.351        2.124        0.659        0.672       0.616
sieve(30)            6.635       0.881        0.865        0.826        0.308        0.291       0.264
strcat(200000)      49.516       0.120        0.118        0.117        0.063        0.047       0.045
--------------     -------      ------       ------       ------       ------       -----        -----
Total              195.497      30.145       29.527       26.642       10.343       10.287       8.794
Defined tags for this entry: ,

Trackback specific URI for this entry

3 Comments to "Benchmark of PHP Branches 3.0 through 5.3-CVS"

Display comments as (Linear | Threaded)
  1. Jani
    07/02/2008 at 13:24 Permalink
    What about HEAD? :)

    Reply

  2. Sebastian Bergmann
    07/02/2008 at 13:31 Permalink
    HEAD = PHP_5_3 + Unicode, and I do not care about Unicode ;-)

    Reply

  3. JP
    20/08/2009 at 16:08 Permalink
    Just to be a pedant, every place you said "is X times faster", you should have said "is X times the speed". 2.5 times faster means 3.5 times the speed (2.5 times over the base of 1), whereas 2.5 times the spead means the base (1) multiplied 2.5 times.

    Yes, I'm a pedant, I know :)

    Reply

1 Trackback to "Benchmark of PHP Branches 3.0 through 5.3-CVS"

  1. PHPDeveloper.org 07/02/2008 at 14:30
    Sebastian Bergmann has posted the results of some benchmarking on the ...

Add Comment


To prevent automated Bots from commentspamming, please enter the string you see in the image below in the appropriate input box. Your comment will only be submitted if the strings match. Please ensure that your browser supports and accepts cookies, or your comment cannot be verified correctly.
CAPTCHA

Submitted comments will be subject to moderation before being displayed.