Hi,
We are migrating our webhosting platform from Solaris on I386 to OpenSolaris on
SPARC. It seems our website work a lot faster on the I386 platform than on the
SPARC platform. PHP seems to be the bottleneck and we believe it has something
to do with the performance of PHP arrays. Our test script takes about 1.5s on
I386 and about 4.5s on SPARC. The i386 is a Sun Fire V20z server, the SPARC is
a Sun T5120 server. The test script is:
<?php
function getmicrotime($time)
{
list($usec,$sec)=explode(" ",$time);
return ((float)$usec+(float)$sec);
}
$start=microtime();
$a=array();
for($i=0; $i<1000000;$i++) {
$a[] = $i;
}
$end=microtime();
$tijd=getmicrotime($end)-getmicrotime($start);
echo 'Duur van het uitvoeren: '.number_format($tijd*1000,5,',','.').'
ms'.PHP_EOL;
$start=microtime();
foreach ($a as $i)
{
}
$end=microtime();
$tijd=getmicrotime($end)-getmicrotime($start);
echo 'Duur van het uitvoeren: '.number_format($tijd*1000,5,',','.').'
ms'.PHP_EOL;
?>
I both used the PHP 5.2 from pkg.opensolaris.org and compiled my own version of
PHP 5.3. Almost identical results.
Any ideas?
--
This message posted from opensolaris.org
_______________________________________________
perf-discuss mailing list
[email protected]