4 ms·
One very important motivation what I do not see clearly delineated in this post is for Event-driven applications. Swoole[1] is an example of a PHP framework whi
by bratao 8y ago
One very important motivation what I do not see clearly delineated in this post is for Event-driven applications.
Swoole[1] is an example of a PHP framework which enable some very interesting uses such as Websocket services.
In those long lived processes, a JIT really shines!
[1] https://www.swoole.co.uk/ https://www.swoole.co.uk/
- kyriakos 8y agoKnow any production grade projects using swoole? I was looking at it in the past but looks very early to trust a business on it.
- bogdanu 8y agoAfaik the project is pretty old. Never heard of anyone using it in production. There are a few integrations with popular frameworks but nothing production ready because there werent made to live in a eventloop - so, a lot of memory leaks.
- bogdanu 8y agoDo you happen to have any benchmarks with JIT and libries like swoole? I thought the same some days ago, but in theory, the output from JIT lives across requests so it shouldn't matter if its a long lived process or simply a normal PHPfpm process. Also, the usual bottleneck in PHP is I/O.
- kyriakos 8y agoin long running processes like Swoole, there is no web server running in front of PHP meaning PHP does some more heavy lifting which could benefit from JIT.
- beberlei 8y agoThat is not entirely correct. Swoole already takes away a lot of the CPU heavy code, like HTTP protocol parsing by providing it in its C extension. For one of my PHP extensions I benchmarked the C level implementation to be 5x faster than Jitted PHP code: https://beberlei.de/2019/03/25/the_jit_in_relation_to_php_extensions.html https://beberlei.de/2019/03/25/the_jit_in_relation_to_php_ex... So no, if your Swoole application does a lot of async I/O and its only in CPU code to delegate between I/O, then it will not benefit from the JIT. "Long-Running process" alone doesn't mean that its CPU bound.