Sebastian Bergmann »
07 November 2006 »
in Benchmarks »
Last month I got a bit bored and
built PHP 4.4.4, PHP 5.0.5, PHP 5.1.6, and current PHP_5_2 (the last two each with CALL, GOTO, and SWITCH VMs) with GCC 3.4.6 and GCC 4.1.1 with -O{0|1|2|3|s}. Yes, this means I built 80 PHP binaries. No, I did not do this manually.
Below are the results of running
bench.php with each of the binaries that I built.

As you can see, PHP 5.1 and PHP 5.2 are both around three times faster than PHP 4.4 and PHP 5.0 (GCC 3.4.6,
-O2).

Each binary ran the benchmark script five times, the numbers shown are the respective mean from the five runs.
The numbers for PHP 5.1.6 and PHP 5.2 are based upon the
CALL-based virtual machine as
GOTO and SWITCH did not work for most of the optimization levels.
Update: Yesterday I built PHP 4.4.4, PHP 5.0.5, PHP 5.1.6, and PHP 5.2.0 with ICC 9.1.042 using
-O{0|1|2|3|s} and
-fast.

Below is a chart that directly compares GCC 3.4.6, GCC 4.1.1, and ICC 9.1.042.

The GCC versions used were
Gentoo sys-devel/gcc-4.1.1-r1 and
Gentoo sys-devel/gcc-3.4.6-r2 together with
Gentoo sys-devel/binutils-2.17.
The
CFLAGS used for GCC were
"-march=pentium-m -msse3 -O{0|1|2|3|s} -pipe".
The
configure options used were
"--disable-all --disable-cgi".
The extended body of this posting contains the raw test results as well as detailed information on the hardware used to run the benchmarks.
Continue reading "PHP / GCC / ICC Benchmark"
Sebastian Bergmann »
25 January 2006 »
in Benchmarks »
I updated my
previous benchmark of
PHP 5.1. This time around I built PHP with
GCC 3.4.5,
GCC 4.0.2, and
GCC 4.1.0.
The bottom line result seems to be that GCC 4 generates slightly slower code:
GCC 3.4.5: 15.223
GCC 4.0.2: 17.896
GCC 4.1.0: 17.847
When I have more time, I will investigate this further using alternative optimizations, including profiling-guided ones.
Continue reading "PHP 5.1 / GCC Benchmark (Update)"
Sebastian Bergmann »
14 June 2005 »
in PHP »
Over the last couple of days I benchmarked the three execution models (CALL, GOTO, SWITCH) that the new virtual machine of PHP 5.1 offers against PHP 5.0.4 and PHP 4.3.11 (results with GCC 3.4.4, GCC 4.0.1).
Initial results show that PHP 5.1's GOTO-based executor gives a 400% better performance than PHP 4 and PHP 5.0. The benchmark script used is available here.
In PHP 5.1.0 the default executor will be CALL as it is the most tested one. You can use GOTO or SWITCH by using the --with-zend-vm={CALL|GOTO|SWITCH} configure parameter. GOTO and SWITCH currently segfault on the Ackermann benchmark, but this is being worked on.
Continue reading "PHP 5.1 Performance"