PHP / GCC / ICC Benchmark
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
Below are the results of running

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,

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
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
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
The
The extended body of this posting contains the raw test results as well as detailed information on the hardware used to run the benchmarks.
-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.
Raw Data
PHP 4.4.4, gcc-3.4.6 (O0): 46.8846 PHP 4.4.4, gcc-3.4.6 (O1): 30.0452 PHP 4.4.4, gcc-3.4.6 (O2): 31.683 PHP 4.4.4, gcc-3.4.6 (O3): 31.9084 PHP 4.4.4, gcc-3.4.6 (Os): 29.8004 PHP 4.4.4, gcc-4.1.1 (O0): 49.53 PHP 4.4.4, gcc-4.1.1 (O1): 31.4644 PHP 4.4.4, gcc-4.1.1 (O2): 31.7962 PHP 4.4.4, gcc-4.1.1 (O3): 32.179 PHP 4.4.4, gcc-4.1.1 (Os): 32.6704 PHP 4.4.4, icc-9.1.042 (O0): 45.760 PHP 4.4.4, icc-9.1.042 (O1): 32.328 PHP 4.4.4, icc-9.1.042 (O2): 26.610 PHP 4.4.4, icc-9.1.042 (O3): 26.809 PHP 4.4.4, icc-9.1.042 (Os): 28.659 PHP 4.4.4, icc-9.1.042 (fast): 26.891 PHP 5.0.5, gcc-3.4.6 (O0): 48.5814 PHP 5.0.5, gcc-3.4.6 (O1): 29.0156 PHP 5.0.5, gcc-3.4.6 (O2): 28.8424 PHP 5.0.5, gcc-3.4.6 (O3): 28.8292 PHP 5.0.5, gcc-3.4.6 (Os): 26.655 PHP 5.0.5, gcc-4.1.1 (O0): 50.1632 PHP 5.0.5, gcc-4.1.1 (O1): 29.6024 PHP 5.0.5, gcc-4.1.1 (O2): 28.9848 PHP 5.0.5, gcc-4.1.1 (O3): 29.057 PHP 5.0.5, gcc-4.1.1 (Os): 32.6502 PHP 5.0.5, icc-9.1.042 (O0): 47.031 PHP 5.0.5, icc-9.1.042 (O1): 32.847 PHP 5.0.5, icc-9.1.042 (O2): 25.196 PHP 5.0.5, icc-9.1.042 (O3): 25.112 PHP 5.0.5, icc-9.1.042 (Os): 26.133 PHP 5.0.5, icc-9.1.042 (fast): 23.756 PHP 5.1.6 (VM: CALL), gcc-3.4.6 (O0): 19.9088 PHP 5.1.6 (VM: CALL), gcc-3.4.6 (O1): 12.0674 PHP 5.1.6 (VM: CALL), gcc-3.4.6 (O2): 11.398 PHP 5.1.6 (VM: CALL), gcc-3.4.6 (O3): 11.3282 PHP 5.1.6 (VM: CALL), gcc-3.4.6 (Os): 11.2306 PHP 5.1.6 (VM: CALL), gcc-4.1.1 (O0): 20.4064 PHP 5.1.6 (VM: CALL), gcc-4.1.1 (O1): 11.6848 PHP 5.1.6 (VM: CALL), gcc-4.1.1 (O2): 11.1316 PHP 5.1.6 (VM: CALL), gcc-4.1.1 (O3): 11.0876 PHP 5.1.6 (VM: CALL), gcc-4.1.1 (Os): 13.8992 PHP 5.1.6 (VM: CALL), icc-9.1.042 (O0): 20.522 PHP 5.1.6 (VM: CALL), icc-9.1.042 (O1): 13.966 PHP 5.1.6 (VM: CALL), icc-9.1.042 (O2): 10.301 PHP 5.1.6 (VM: CALL), icc-9.1.042 (O3): 10.353 PHP 5.1.6 (VM: CALL), icc-9.1.042 (Os): 11.001 PHP 5.1.6 (VM: CALL), icc-9.1.042 (fast): 9.331 PHP 5.1.6 (VM: GOTO), gcc-3.4.6 (O0): 18.8796 PHP 5.1.6 (VM: GOTO), gcc-3.4.6 (O2): 9.7342 PHP 5.1.6 (VM: GOTO), gcc-3.4.6 (O3): 9.972 PHP 5.1.6 (VM: GOTO), gcc-3.4.6 (Os): 10.051 PHP 5.1.6 (VM: GOTO), gcc-4.1.1 (O1): 10.216 PHP 5.1.6 (VM: GOTO), gcc-4.1.1 (O2): 9.8896 PHP 5.1.6 (VM: GOTO), gcc-4.1.1 (O3): 9.8724 PHP 5.1.6 (VM: GOTO), gcc-4.1.1 (Os): 12.7706 PHP 5.1.6 (VM: SWITCH), gcc-3.4.6 (O0): 20.0308 PHP 5.1.6 (VM: SWITCH), gcc-3.4.6 (O2): 10.2184 PHP 5.1.6 (VM: SWITCH), gcc-3.4.6 (O3): 10.3852 PHP 5.1.6 (VM: SWITCH), gcc-3.4.6 (Os): 12.2126 PHP 5.1.6 (VM: SWITCH), gcc-4.1.1 (O1): 10.6876 PHP 5.1.6 (VM: SWITCH), gcc-4.1.1 (O2): 10.564 PHP 5.1.6 (VM: SWITCH), gcc-4.1.1 (O3): 10.6248 PHP 5.1.6 (VM: SWITCH), gcc-4.1.1 (Os): 15.2186 PHP 5.2.0 (VM: CALL), gcc-3.4.6 (O0): 21.7908 PHP 5.2.0 (VM: CALL), gcc-3.4.6 (O1): 12.2534 PHP 5.2.0 (VM: CALL), gcc-3.4.6 (O2): 11.5976 PHP 5.2.0 (VM: CALL), gcc-3.4.6 (O3): 11.3194 PHP 5.2.0 (VM: CALL), gcc-3.4.6 (Os): 11.6044 PHP 5.2.0 (VM: CALL), gcc-4.1.1 (O0): 22.2472 PHP 5.2.0 (VM: CALL), gcc-4.1.1 (O1): 11.9178 PHP 5.2.0 (VM: CALL), gcc-4.1.1 (O2): 11.3162 PHP 5.2.0 (VM: CALL), gcc-4.1.1 (O3): 11.1834 PHP 5.2.0 (VM: CALL), gcc-4.1.1 (Os): 14.0054 PHP 5.2.0 (VM: CALL), icc-9.1.042 (O0): 21.687 PHP 5.2.0 (VM: CALL), icc-9.1.042 (O1): 14.391 PHP 5.2.0 (VM: CALL), icc-9.1.042 (O2): 10.331 PHP 5.2.0 (VM: CALL), icc-9.1.042 (O3): 10.477 PHP 5.2.0 (VM: CALL), icc-9.1.042 (Os): 11.338 PHP 5.2.0 (VM: CALL), icc-9.1.042 (fast): 9.763 PHP 5.2.0 (VM: GOTO), gcc-4.1.1 (Os): 12.8902 PHP 5.2.0 (VM: SWITCH), gcc-4.1.1 (Os): 15.1576Output of
cat /proc/cpuinfo
processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 14 model name : Genuine Intel(R) CPU L2400 @ 1.66GHz stepping : 8 cpu MHz : 1000.000 cache size : 2048 KB physical id : 0 siblings : 2 core id : 0 cpu cores : 2 fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 10 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx constant_tsc pni monitor vmx est tm2 xtpr bogomips : 3328.67 processor : 1 vendor_id : GenuineIntel cpu family : 6 model : 14 model name : Genuine Intel(R) CPU L2400 @ 1.66GHz stepping : 8 cpu MHz : 1667.000 cache size : 2048 KB physical id : 0 siblings : 2 core id : 1 cpu cores : 2 fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 10 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx constant_tsc pni monitor vmx est tm2 xtpr bogomips : 3325.12Output of
x86info
x86info v1.20. Dave Jones 2001-2006 Feedback to <davej@redhat.com>. Found 2 CPUs -------------------------------------------------------------------------- CPU #1 Family: 6 Model: 14 Stepping: 8 Type: 0 Brand: 0 CPU Model: Core Original OEM Feature flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat clflsh ds acpi mmx fxsr sse sse2 ss ht tm pbe sse3 monitor vmx est tm2 xTPR Extended feature flags: xd Cache info L1 Instruction cache: 32KB, 8-way associative. 64 byte line size. L1 Data cache: 32KB, 8-way associative. 64 byte line size. L2 unified cache: 2MB, sectored, 8-way associative. 64 byte line size. TLB info Instruction TLB: 4K pages, 4-way associative, 128 entries. Instruction TLB: 4MB pages, fully associative, 2 entries Data TLB: 4K pages, 4-way associative, 128 entries. Data TLB: 4MB pages, 4-way associative, 8 entries 64 byte prefetching. The physical package supports 2 logical processors -------------------------------------------------------------------------- CPU #2 Family: 6 Model: 14 Stepping: 8 Type: 0 Brand: 0 CPU Model: Core Original OEM Feature flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat clflsh ds acpi mmx fxsr sse sse2 ss ht tm pbe sse3 monitor vmx est tm2 xTPR Extended feature flags: xd Cache info L1 Instruction cache: 32KB, 8-way associative. 64 byte line size. L1 Data cache: 32KB, 8-way associative. 64 byte line size. L2 unified cache: 2MB, sectored, 8-way associative. 64 byte line size. TLB info Instruction TLB: 4K pages, 4-way associative, 128 entries. Instruction TLB: 4MB pages, fully associative, 2 entries Data TLB: 4K pages, 4-way associative, 128 entries. Data TLB: 4MB pages, 4-way associative, 8 entries 64 byte prefetching. The physical package supports 2 logical processors --------------------------------------------------------------------------
24/10/2006 at 15:02 Permalink
Reply
15/02/2007 at 23:00 Permalink
And half of my gentoo system is still compiled with it :)
Reply
16/11/2006 at 14:56 Permalink
http://www.blogs.uni-erlangen.de/webworking/stories/648/
Reply
02/01/2007 at 23:13 Permalink
Reply