I just upgraded to php 5.3.8 using dotdeb.org’s apt source.
The test result of php performance is very bad.
I test with this script, before and after install php5.3.8. It seems to run the same code will take 10 times time in php5.3.8 than in php5.3.7.
Test php script:
<?php
//test float
function test_float() {
$t = pi();
$timeStart = gettimeofday();
for($i = 0; $i < 3000000; $i++) {
sqrt($t);
}
$timeEnd = gettimeofday();
$time = ($timeEnd["usec"]-$timeStart["usec"])/1000000+$timeEnd["sec"]-$timeStart["sec"];
$time = round($time, 3)."s";
return $time;
}
echo "php version:" , phpversion(), "\n";
echo "call sqrt() 3,000,000 times will cost ", test_float(), "\n";
?>
Test result:
php version:5.3.3-7+squeeze3
call sqrt() 3,000,000 times will cost 1.369s
php version:5.3.3-7+squeeze3
call sqrt() 3,000,000 times will cost 1.095s
php version:5.3.3-7+squeeze3
call sqrt() 3,000,000 times will cost 1.072s
php version:5.3.8-1~dotdeb.2
call sqrt() 3,000,000 times will cost 10.644s
php version:5.3.8-1~dotdeb.2
call sqrt() 3,000,000 times will cost 10.567s
php version:5.3.8-1~dotdeb.2
call sqrt() 3,000,000 times will cost 10.343s
The 5.3.8 version may have been compiled with debug options, or without compiler optimisations.
Or you may have added some slow extension in PHP 5.3.8 that’s not enabled in PHP 5.3.7, like xdebug or suhosin.
I would bet for the second solution.
php -m. (List of loaded modules.)php -n(runs PHP without loading any ini settings file)