Is the JIT in PHP 8 working for you? I Have multiple problems with it.


– Runtime errors that do not exist without JIT
– The source line numbers are not correct in the runtime errors
– Segmentation faults
JIT attempts to compile segments of code to native CPU instructions completely bypassing the ZEND engine.
So yes, Errors in code witch is JIT’d are far more catastrophic. Make sure you are doing the following:
All variables, functions, properties are strictly typed.Make sure no variable is null or a value which is erroneous. Trying to add ‘Some string you think is an int’ to 5 will cause a complete crash.Since JIT bypassing ZEND, the ZEND VM won’t be able to clean up memory of JIT’d code.And other notes, Make sure you check the docs for how to utilise JIT with minimum errors.
AKA to use JIT properly, you need to code properly, you cant just turn on JIT and expect instant results.
So far my Discord Bot framework is working fine, But there are errors in ReactPHP since their code isn’t completely JIT safe. So I needed to change some my code to make sure I returned a value on everything ReactPHP called since it try use a value if one is returned. So in JIT, if a value isn’t returned, it would crash.
I find it hard to believe that WordPress was coded with such care, how did they benchmark WordPress with JIT? Maybe just luck…
I got mine working quite easy. But was so disappointed when making performance Tests. Tried all different combinations and still worse than standard php8 + preloading. I run a pure json api on nginx with an average of 2 MySQL queries per request. Since I use json webtoken auth and try to avoid additional db requests as good as possible, I was very disappointed when seeing the performance. In most of the cases it’s even slower than normal config. Even when I scaled up to 200 concurrent requests. Tested on native php8 webserver.
Is your application a good fit for jit? I think long running, cpu intensive applications are the type that can benefit from it. Otherwise it may actually slow things down like what you described.
The 2 Mysql queries are probably taking most of the time. You could try to run them in parallel with Mysqli, if possible.
JIT is alot different from standard PHP, Javascript has had JIT for years and they still have massive errors for weird usecases which are completely accepted in JS standard, but when that code gets JIT’d its stack nightmare.
I think the problem is that pretty much all of the main PHP coders have 0 experience writing modern clean PHP
You really have high opinion on your skills, even though you have been banned few times. Take a look at Dunning-Kruger syndrome.
I think the problem is that pretty much all of the main PHP coders have 0 experience writing modern clean PHP and probably even less time running their creations on modern web stacks.
That’s ridiculous. The JIT is almost entirely written by Dmitry Stogov who has been working on PHP since the early Zend days. Writing a JIT is mind-bogglingly complex. The fact that he pulled it off alone itself is amazing. It does have bugs but that is to be expected as it is a completely new backend to a 25 year old language.


A though it’s anything different with any other software. Take Windows, for example…
Members
Online

source