I did some benchmarking of PHP compiled with gcc 4.0.1. Results and
methodology are described at:
http://wp.wikidev.net/GCC_benchmarking
I eventually settled on -O3 with profile-guided optimisation. This gave
a 5-10% improvement over the old PHP 4.3.11 build on all the benchmarks
except preg_replace. The preg_replace problem is probably because the
benchmark was atypical compared to the profiling data, which was
gathered using refreshLinks.php.
-- Tim Starling