php-7.0-mod_php-apache2.4 vs. HHVM performance quick test 2017-03-12 13:41
/ / /
php-7.0-mod_php-apache2.4 vs. HHVM performance quick test
All Test Env is by default, no additional fine tune,
so don't take these test too serious.
Box: Virtual Box @ Intel Core-i7 4-Core
Linux OS: Ubuntu 16.04.02
Kernel: 4.4.0-64 X86_64 SMP
Apache 2.4: Apache/2.4.18, 2016-07-14T12:32:26
PHP: PHP 7.0.15-0ubuntu0.16.04.4, mod_php7
HHVM: HipHop VM 3.18.1 (rel)
Test (1): random & hash test
php7-mod_php faster, 16s(mod_php) vs 23s(hhvm)
代碼:
<?PHP
function prepare_random_source()
{
$rtn = '';
for ($i=1; $i<=256; $i++)
{
$rtn .= mt_rand( 0, 9 ).'';
}
return $rtn;
}
$loop = 131072 * 2;
$t1 = time();
while($loop-- > 0)
{
$s1 = prepare_random_source();
$s2 = sha1(md5($s1));
$s3 = crc32($s1.$s2.mt_rand( 0, 1048576 ).'-'.time());
if ($loop % 2)
{
$s4 = mt_rand(1, 255) xor mt_rand(1, 255);
}
}
$t2 = time();
echo $t2 - $t1."\n";
?>
________________
美術插畫設計案子報價系統 v0.1 Beta
爪哇禾雀



