I executed the Zend\bench.php file using PHP 7.4.10 and PHP 8 beta4.
I used a CPU Intel i9-8950HK at 2.90GHz with 32GB RAM running Ubuntu 18.04.4 LTS.
I compiled PHP 8 beta4 using the official php.net source and installed in /opt/php/php8
. I used the following options:
./configure --prefix=/opt/php/php8 --enable-opcache --with-zlib --enable-zip --enable-json --enable-sockets --without-pear
I used the PHP 7.4.10 version using the ppa:ondrej/php repository.
To run the benchmark I used the command as follows:
php -d opcache.enable_cli=0 Zend/bench.php
php -d opcache.enable_cli=1 Zend/bench.php
/opt/php/php8/bin/php -d opcache.enable_cli=0 Zend/bench.php
/opt/php/php8/bin/php -d opcache.enable_cli=1 Zend/bench.php
/opt/php/php8/bin/php -d opcache.enable_cli=1 -d opcache.jit_buffer_size=128M -d opcache.jit=1235 Zend/bench.php
I run the experiment 5 times for each PHP configuration and I took the average (last row in the table). The time are reported in seconds.
PHP 7.4.10 | PHP 7.4.10 + opcache | PHP 8 beta4 | PHP 8 beta4 + opcache | PHP 8 beta4 + opcache + JIT (1235) |
---|---|---|---|---|
0.338 | 0.214 | 0.312 | 0.223 | 0.103 |
0.336 | 0.206 | 0.308 | 0.218 | 0.102 |
0.329 | 0.197 | 0.313 | 0.213 | 0.100 |
0.330 | 0.219 | 0.306 | 0.225 | 0.104 |
0.337 | 0.216 | 0.306 | 0.207 | 0.102 |
----- | ----- | ----- | ----- | ----- |
0.334 | 0.210 | 0.309 | 0.217 | 0.102 |