6 ms·
PHP has a JIT coming in 8.0, using the same underlying tech that LuaJit does. Unfortunately, most of what people do with PHP isn't CPU bound, so it doesn't hel
by tyingq 6y ago
PHP has a JIT coming in 8.0, using the same underlying tech that LuaJit does. Unfortunately, most of what people do with PHP isn't CPU bound, so it doesn't help much.
- pizlonator 6y agoAnd let’s not forget HHVM. That was (is?) quite the beast.
- pastrami_panda 6y ago> most of what people do with PHP isn't CPU bound ... cause it's I/O bound? Just curious.
- pizlonator 6y agoI feel like I can almost visualize the killshot slides that the HipHop and HHVM folks used to show the extent to which PHP can be CPU bound and the extent to which server idle time can be increased by using speculative compilation tricks on PHP. So, I think it is cpu bound for at least some people.
- tyingq 6y agoVersus PHP5.x that's true. Mostly because the PHP internals were inefficient. The performance differences vs HHVM vanished with PHP 7.x.
- jashmatthews 6y agoHHVM's 2nd generation region based JIT performs enormously better than PHP7.x in places where dynamic languages don't perform so well but PHP7.x has the clear lead when benchmarking large apps like WordPress.
- tyingq 6y agoI get where the "rooting for the underdog" feeling comes from, but it still feels good that the relatively small and underfunded PHP team mostly beat Facebook here. I like to imagine there is some internal debate at FB on whether to just go back to mainline PHP and kill HHVM. Especially with a credible JIT coming.
- tyingq 6y agoYes, or just waiting on MySQL, for example. The JIT does dramatically speed up microbenchmarks like Mandlebrot, etc. 5x.
- tambourine_man 6y agoThis could be a chicken and egg thing. As soon as JavaScript started to get faster, we started using it for more CPU intensive tasks, which in turn led to more investment in optimizations, and so on, in a virtuous circle.
- qaq 6y agoLarge entities are competing on browser performance "which in turn led to more investment in optimizations" part does not really ring true. We are just benefiting from browser market dynamics.
- tambourine_man 6y agoBrowser competition helped a lot, but if you have a large body of CPU bound code, you can bet people will work hard to optimize it.
- saagarjha 6y agoPython?
- jashmatthews 6y agoLuaJIT 2.x only uses Dynasm to generate the bytecode VM and not for actual JIT compilation. Runtime JIT is done differently. Dynasm is actually written in Lua. There's a good guide by Peter Crawley on how to run it here: https://corsix.github.io/dynasm-doc/tutorial.html#compiling https://corsix.github.io/dynasm-doc/tutorial.html#compiling
- tyingq 6y agoYes, I suppose "in the same way earlier versions of LuaJIT worked" would be more accurate.
- jashmatthews 6y agoLuaJIT 1.x was also an enormous disappointment so it’s a bit perplexing that the PHP team would try something which probably sucks.
- rurban 6y agoDon't believe him. The php jit us entirely different from Lua hit, other than using dynasm. Even raku is using dynasm. The PHP jit is actually much easier to understand. With SSA for all tiers, CFG, but not that much type speculation at all. The advantage of php, Perl, Ruby over JS is that objects don't vary that much, methods are not overridden that much, and arrays and hashes are much easier. The php jit is at least 10x easier and smaller than JSC. Also C, not C++.
- tyingq 6y agoUnderappreciated comment and upvoted.