PHP 5.1 / GCC Benchmark (Update)

Sebastian Bergmann » 25 January 2006 » in Benchmarks » 4 Comments

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.


Detailed Results
Linux wopr-mobile 2.6.15-gentoo-r1 #2 Sun Jan 22 10:33:01 CET 2006
i686 Intel(R) Pentium(R) M processor 1500MHz GenuineIntel GNU/Linux

CFLAGS: -march=pentium-m -Os -pipe
./configure --disable-cgi --disable-all


sb@wopr-mobile bench % ll
total 5028
-rwxr-xr-x 1 sb users 1863347 Jan 25 08:04 php-gcc34
-rwxr-xr-x 1 sb users 1635741 Jan 25 07:59 php-gcc40
-rwxr-xr-x 1 sb users 1630777 Jan 25 07:55 php-gcc41


sb@wopr-mobile bench % ../bin/analyse-x86 --vendor=intel php-gcc34
Checking vendor_id string...intel
Disassembling php-gcc34, please wait...
i486:    2 i586:    0 ppro:  135 mmx:    1 sse:    4 sse2:  296
php-gcc34 will run on Pentium IV (pentium4) or higher processor.

sb@wopr-mobile bench % ../bin/analyse-x86 --vendor=intel php-gcc40
Checking vendor_id string...intel
Disassembling php-gcc40, please wait...
i486:    2 i586:    0 ppro:  101 mmx:    0 sse:    0 sse2:  133
php-gcc40 will run on Pentium IV (pentium4) or higher processor.

sb@wopr-mobile bench % ../bin/analyse-x86 --vendor=intel php-gcc41
Checking vendor_id string...intel
Disassembling php-gcc41, please wait...
i486:    2 i586:    0 ppro:  100 mmx:    0 sse:    0 sse2:  135
php-gcc41 will run on Pentium IV (pentium4) or higher processor.


gcc (GCC) 3.4.5 (Gentoo 3.4.5, ssp-3.4.5-1.0, pie-8.7.9)

  simple             0.651
  simplecall         0.615
  simpleucall        0.982
  simpleudcall       1.112
  mandel             1.763
  mandel2            2.139
  ackermann(7)       1.021
  ary(50000)         0.109
  ary2(50000)        0.098
  ary3(2000)         1.027
  fibo(30)           2.740
  hash(50000)        0.161
  hash2(500)         0.147
  heapsort(20000)    0.494
  matrix(20)         0.449
  nestedloop(12)     1.095
  sieve(30)          0.526
  strcat(200000)     0.093
  ------------------------
  Total             15.223


gcc (GCC) 4.0.2 (Gentoo 4.0.2-r3, pie-8.7.8)

  simple             0.806
  simplecall         0.715
  simpleucall        1.088
  simpleudcall       1.221
  mandel             2.319
  mandel2            2.663
  ackermann(7)       1.124
  ary(50000)         0.119
  ary2(50000)        0.103
  ary3(2000)         1.165
  fibo(30)           3.042
  hash(50000)        0.174
  hash2(500)         0.175
  heapsort(20000)    0.569
  matrix(20)         0.502
  nestedloop(12)     1.393
  sieve(30)          0.616
  strcat(200000)     0.103
  ------------------------
  Total             17.896

gcc (GCC) 4.1.0-beta20060120  (prerelease)

  simple             0.795
  simplecall         0.726
  simpleucall        1.095
  simpleudcall       1.246
  mandel             2.299
  mandel2            2.605
  ackermann(7)       1.136
  ary(50000)         0.120
  ary2(50000)        0.103
  ary3(2000)         1.156
  fibo(30)           3.064
  hash(50000)        0.171
  hash2(500)         0.174
  heapsort(20000)    0.572
  matrix(20)         0.492
  nestedloop(12)     1.368
  sieve(30)          0.621
  strcat(200000)     0.103
  ------------------------
  Total             17.847
Defined tags for this entry: , ,

Trackback specific URI for this entry

4 Comments to "PHP 5.1 / GCC Benchmark (Update)"

Display comments as (Linear | Threaded)
  1. Stéphane
    05/02/2006 at 23:16 Permalink
    Bonjour, PHP 5,1,2 est vraiment plus rapide que de vieilles versions de PHP? ce qui vous conseillent pour l'installation: apx, cgi ou fixed? PHP 5,1,2 est-il vraiment prêt pour le serveur de production? Thanx.

    Reply

  2. Sebastian Bergmann
    06/02/2006 at 07:26 Permalink
    Sorry, I do not speak/understand French.

    Reply

  3. Stéphane
    06/02/2006 at 12:15 Permalink
    Hello, PHP 5.1.2 is really faster than old versions of PHP? what do you advise for the installation: apx, cgi or fixed? Is PHP 5.1.2 really ready for server production? Thanx.
    (NB: sorry my english is limited)

    Reply

  4. Sebastian Bergmann
    08/02/2006 at 12:28 Permalink
    If you're using Apache and want to continue using Apache you should use mod_php (USE=apache(2) emerge dev-lang/php in Gentoo).

    If you're open to something new you might want to look at lighttpd (USE="fastcgi php" emerge lighttpd dev-lang/php in Gentoo).

    Reply

0 Trackbacks to "PHP 5.1 / GCC Benchmark (Update)"

  1. No Trackbacks

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.