What is the difference between the JIT compiler and OpCache? Does JIT always improve performance?
Last updated
OpCache caches compiled opcodes (bytecode) in shared memory to skip re-parsing, but the Zend VM still executes them.
JIT builds on OpCache by compiling hot opcodes into native machine code, configured via
opcache.jitandopcache.jit_buffer_size.JIT does not always help: I/O-bound web apps gain little, while CPU-heavy work benefits. Benchmark before enabling it.
- https://medium.com/@rezahajrahimi/just-in-time-jit-compilation-in-php-8-4-2beab4d1212c
- https://dev.to/vishal_rajput_310e810159e/php-jit-compiler-4kk1
- https://www.edgeservers.com.au/en/articles/php-opcache-jit
- https://www.zend.com/blog/exploring-new-php-jit-compiler
- https://wiki.php.net/rfc/jit
- https://wiki.php.net/rfc/jit-ir
- https://blog.stackademic.com/detailed-guide-to-using-php-jit-17c8b050783b
- https://php.watch/articles/jit-in-depth