Ok, so i really do want to use and believe in HHVM however in every test I perform HHVM is coming out slower than PHP. I have run many many different test some very complex scripts with lots of processing to simple scripts. For demonstration I shall show you the results with a (really) simple script.
public function hhvm(){
$list = array(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25);
$this->benchmark->mark('code_start');
for ($i=0 ; $i<100 ; $i++) {
serialize($list);
}
$this->benchmark->mark('code_end');
echo $this->benchmark->elapsed_time('code_start', 'code_end');
}
Both HHVM and PHP are running on the same server in CLI: System is...
- Ubuntu 14.04
- 4 SSDs in RAID 0
- 2x Hexcore Xeons
- 64GB Ram
- Codeigniter 3.0 (framework)
- PHP 5.5.9
- HHVM (Latest stable release as of 2/7/2015)
This script run 20 times under each of the below commands with the following results:
"hhvm /var/www/vhosts/test.local/httpdocs/index.php test hhvm"
Average execution time = 0.0021
"hhvm -v Eval.Jit=1 -v Eval.JitProfileInterpRequests=0 /var/www/vhosts/test.local/httpdocs/index.php test hhvm"
Average execution time = 0.0020
"php /var/www/vhosts/test.local/httpdocs/index.php test hhvm"
Average execution time = 0.0003
Obviously this is a small script, i have ran much much larger scripts through it and the times i were seeing were PHP = 5.2s HHVM = 6.4s which doesn't seem a lot but when you have too many of these running it all adds up.
So my question is.. What the hell am i doing wrong? Why can i not set HHVM to run quicker than PHP. (is it an incompatibly with CI3.0? even though the HHVM site says 100% compatible?)
EDIT: So after searching and searching it seems nobody can provide an answer, I have tested without the CI3 frame work using just standard PHP and the results are pretty much the same, I have asked 3 others on different forums to test and they get exactly the same results. I conclude that HHVM is a load of hype and in real world scenarios it just doesnt cut the mustard. If there is anyone out there than can prove me wrong I would love to hear from you as, in theory, HHVM sounds amazing and I would love to use something that optimises the execution of code as much as it claims to do.