Obsolete:GCC benchmarking
Appearance
This page contains historical information. It may be outdated or unreliable.
Here are some benchmark results for PHP compiled with GCC 4.0.1 versus GCC 3.2.2. Results are typically stable to about 1%.
Benchmark script - Test input - NFC test input
Associated mailing list announcement
Old build: PHP 4.3.11 compiled with gcc 3.2.2 -O2
Tight loop: 0.514458203316 us doBlockLevels: 34.7585201263 ms doTableStuff: 4.51628994942 ms String concatenation x1000: 0.884188294411 ms NFC: 130.836920738 ms preg_replace: 7.17005205154 ms
PHP 4.4.0 compiled with gcc 3.2.2 -O3
Tight loop: 0.529537200928 us doBlockLevels: 36.1865615845 ms doTableStuff: 4.6063349247 ms String concatenation x1000: 0.874975395203 ms NFC: 130.677857399 ms preg_replace: 9.54832410812 ms
PHP 4.4.0 compiled with gcc 4.0.1 -O3
Tight loop: 0.462446498871 us doBlockLevels: 36.2876796722 ms doTableStuff: 4.38923716545 ms String concatenation x1000: 0.816931509972 ms NFC: 130.018181801 ms preg_replace: 7.79179096222 ms
PHP 4.4.0 gcc4 -O3 -march=pentium4
Tight loop: 0.494507002831 us doBlockLevels: 36.3027191162 ms doTableStuff: 4.4699139595 ms String concatenation x1000: 0.817039394379 ms NFC: 129.29461956 ms preg_replace: 8.51239395142 ms
PHP 4.4.0 gcc4 -O3 -march=pentium4 profile-guided
Profiling data was mainly from refreshLinks.php, not from the benchmark itself.
Tight loop: 0.478229784966 us doBlockLevels: 34.7643613815 ms doTableStuff: 4.50187897682 ms String concatenation x1000: 0.807020902634 ms NFC: 126.532878876 ms preg_replace: 7.74664902687 ms
PHP 4.4.0 gcc4 -O2
Tight loop: 0.502064394951 us doBlockLevels: 36.7405986786 ms doTableStuff: 4.64641189575 ms String concatenation x1000: 0.832908701897 ms NFC: 152.706279755 ms preg_replace: 8.65598201752 ms
PHP 4.4.0 gcc4 -O3 profile-guided
preg_replace: 7.99713206291 ms
ab PHP 4.3.11
Note that the difference between the first and second runs is mostly at the slow end of the histogram -- the median is the same.
First run
[0411][tstarling@hypatia:/home/wikipedia/src/php/php-4.4.0-gcc4]$ ab -n1000 -Xlocalhost:80 http://en.wikipedia.org/wiki/Special:Specialpages This is ApacheBench, Version 2.0.41-dev <$Revision: 1.141 $> apache-2.0 Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/ Benchmarking en.wikipedia.org [through localhost:80] (be patient) Completed 100 requests Completed 200 requests Completed 300 requests Completed 400 requests Completed 500 requests Completed 600 requests Completed 700 requests Completed 800 requests Completed 900 requests Finished 1000 requests Server Software: Apache Server Hostname: en.wikipedia.org Server Port: 80 Document Path: /wiki/Special:Specialpages Document Length: 9904 bytes Concurrency Level: 1 Time taken for tests: 91.826427 seconds Complete requests: 1000 Failed requests: 0 Write errors: 0 Total transferred: 10178000 bytes HTML transferred: 9904000 bytes Requests per second: 10.89 [#/sec] (mean) Time per request: 91.826 [ms] (mean) Time per request: 91.826 [ms] (mean, across all concurrent requests) Transfer rate: 108.24 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 0 0 0.0 0 0 Processing: 76 91 85.7 83 2265 Waiting: 71 86 85.8 78 2264 Total: 76 91 85.7 83 2265 Percentage of the requests served within a certain time (ms) 50% 83 66% 84 75% 86 80% 87 90% 91 95% 97 98% 148 99% 271 100% 2265 (longest request)
Second run
[0413][tstarling@hypatia:/home/wikipedia/src/php/php-4.4.0-gcc4]$ ab -n1000 -Xlocalhost:80 http://en.wikipedia.org/wiki/Special:Specialpages This is ApacheBench, Version 2.0.41-dev <$Revision: 1.141 $> apache-2.0 Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/ Benchmarking en.wikipedia.org [through localhost:80] (be patient) Completed 100 requests Completed 200 requests Completed 300 requests Completed 400 requests Completed 500 requests Completed 600 requests Completed 700 requests Completed 800 requests Completed 900 requests Finished 1000 requests Server Software: Apache Server Hostname: en.wikipedia.org Server Port: 80 Document Path: /wiki/Special:Specialpages Document Length: 9904 bytes Concurrency Level: 1 Time taken for tests: 87.275028 seconds Complete requests: 1000 Failed requests: 0 Write errors: 0 Total transferred: 10178000 bytes HTML transferred: 9904000 bytes Requests per second: 11.46 [#/sec] (mean) Time per request: 87.275 [ms] (mean) Time per request: 87.275 [ms] (mean, across all concurrent requests) Transfer rate: 113.88 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 0 0 0.0 0 0 Processing: 76 86 20.9 83 428 Waiting: 72 81 21.1 78 424 Total: 76 86 20.9 83 428 Percentage of the requests served within a certain time (ms) 50% 83 66% 84 75% 86 80% 87 90% 91 95% 97 98% 132 99% 190 100% 428 (longest request)
ab PHP 4.4.0
First run
[0434][tstarling@hypatia:/home/wikipedia/src/turck/turck-for-php440]$ ab -n1000 -Xlocalhost:80 http://en.wikipedia.org/wiki/Special:Specialpages This is ApacheBench, Version 2.0.41-dev <$Revision: 1.141 $> apache-2.0 Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/ Benchmarking en.wikipedia.org [through localhost:80] (be patient) Completed 100 requests Completed 200 requests Completed 300 requests Completed 400 requests Completed 500 requests Completed 600 requests Completed 700 requests Completed 800 requests Completed 900 requests Finished 1000 requests Server Software: Apache Server Hostname: en.wikipedia.org Server Port: 80 Document Path: /wiki/Special:Specialpages Document Length: 9904 bytes Concurrency Level: 1 Time taken for tests: 83.706322 seconds Complete requests: 1000 Failed requests: 0 Write errors: 0 Total transferred: 10177000 bytes HTML transferred: 9904000 bytes Requests per second: 11.95 [#/sec] (mean) Time per request: 83.706 [ms] (mean) Time per request: 83.706 [ms] (mean, across all concurrent requests) Transfer rate: 118.72 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 0 0 0.0 0 0 Processing: 72 83 21.6 79 344 Waiting: 68 78 21.6 75 337 Total: 72 83 21.6 79 344 Percentage of the requests served within a certain time (ms) 50% 79 66% 81 75% 82 80% 83 90% 87 95% 91 98% 113 99% 191 100% 344 (longest request)
Second run
[0436][tstarling@hypatia:/home/wikipedia/src/turck/turck-for-php440]$ ab -n1000 -Xlocalhost:80 http://en.wikipedia.org/wiki/Special:Specialpages This is ApacheBench, Version 2.0.41-dev <$Revision: 1.141 $> apache-2.0 Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/ Benchmarking en.wikipedia.org [through localhost:80] (be patient) Completed 100 requests Completed 200 requests Completed 300 requests Completed 400 requests Completed 500 requests Completed 600 requests Completed 700 requests Completed 800 requests Completed 900 requests Finished 1000 requests Server Software: Apache Server Hostname: en.wikipedia.org Server Port: 80 Document Path: /wiki/Special:Specialpages Document Length: 9904 bytes Concurrency Level: 1 Time taken for tests: 86.94135 seconds Complete requests: 1000 Failed requests: 0 Write errors: 0 Total transferred: 10177000 bytes HTML transferred: 9904000 bytes Requests per second: 11.62 [#/sec] (mean) Time per request: 86.094 [ms] (mean) Time per request: 86.094 [ms] (mean, across all concurrent requests) Transfer rate: 115.43 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 0 0 0.0 0 0 Processing: 73 85 65.7 79 2079 Waiting: 69 80 65.8 75 2078 Total: 73 85 65.7 79 2079 Percentage of the requests served within a certain time (ms) 50% 79 66% 81 75% 83 80% 84 90% 89 95% 98 98% 143 99% 176 100% 2079 (longest request)
So the median dropped from 83ms to 79ms, an improvement of 5%. ?