JIT (Just in Time) compiler in PHP works the same as in the other interpreted programming language. It runs after the program starts and compiles code on the fly (at the runtime).
In PHP8 JIT will omit Zend VM
and if the compiled code is already cached it is sent directly to the CPU. It will not depend on C language and the language will get ability to develop its own new features.
JIT in PHP8 is not a game changer in performance. It will improve it slightly, but not as significantly as PHP7 did. There are already some benchmarks showing that the performance in basic benchmarks (CPU intensive tasks) is much better, but in real-use applications it doesn't change much.
CPU intensive tasks:
- nikic/PHP-Parser ran about 1.3 times faster in benchmark made by Nikita Popov
- A hello world application written with Amp had about 5% speed improvement
- MessagePack benchmarks showed 1.3 to 1.5 times speed up
Results of fresh laravel webpage:
- PHP 7.3: 131.37 req/s
- PHP 8.0 + JIT: 133.57 req/s
Relative JIT contribution to PHP 8 performance source
Comments
Post a Comment