The default installation of php 8.0 I mentioned in the previous post has JIT built-it. But, here is a big BUT, JIT is not enabled.
I used the testing script which is found in this post. The source code can be downloaded at Github. I put a local copy for reference.
I run this php scrip, or bubble.php, at the default settings of PHP 8.0.1. About 10 runs, I got the average time is 0.095 seconds.
Then I try to config the php-fpm to make JIT work.
Edit /etc/php/8.0/fpm/php.ini
opcache.enable =1 opcache.jit_buffer_siez = 100M opcache.jit = 1235
Restart the php8.0-fpm service.
Later I re-run the bubble.php script 10 times. The average time is 0.053 seconds.
As a comparison, php 8.0 JIT vs no-JIT is about 45% faster.
I tested the bubble.php on PHP 7.4.14, as well.
The average time is 0.121 seconds.
It worths upgrading the php-fpm service from 7.4 to 8.0 now if I can solve all the compatible issues. And I will enable JIT, because JIT brings the most improvement of performance.
I set `opcache.jit_buffer_siez = 100M` and phpinfo reports so after a restart, but phpinfo still says JIT is disabled – am I missing something?
It is still confusing me the way to enable JIT.
There are different setting in opcache.ini for different version of the PHP.
Here is an example of enable JIT on PHP 8.2.6.
https://www.yinfor.com/2023/05/enable-jit-on-php8-2-6.html