Hacker News new | ask | show | jobs
by elktea 2097 days ago
as far as I understand, PHP web applications don't benefit from a JIT that much. Each request is like running the entire application from scratch, which is why the opcache can help so much.
3 comments

Modern PHP frameworks initialize "entire application" only once at startup and process each request really fast.

See the benchmarking charts there: https://github.com/gotzmann/comet

It's interesting to see this comment here. In the usual quarterly arguing about PHP posts, the CGI-style "statelessness" is often brought up as a positive feature that differentiates PHP from more "modern" web app stacks.
It is possible to get the best of both worlds if you support both, easy development and performant deployment.
The performance seems pretty impressive! I'd like to see comet being added to techempower's benchmark, to see how it competes against other frameworks.
Sort of. It's not a new process invocation, but it is a new interpreter. Most high volume set ups cache user space startup state in Redis or Apcu. And, as you said, the built in opcache caches the commonly used code.
I wonder why Facebook built HipHop and HHVM and PHP 8 is getting a JIT then.
The PHP team is pretty transparent about the JIT not really helping much with the sort of things people use PHP for. It just opens up using PHP for more CPU intensive stuff that you would have called out to a C library for.