Re:Speculation in JavaScriptCore
by tyingq on Wednesday July 29, 2020 @03:47PM
(#23990831)
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.
[ Parent
| on HN ]
Re:Speculation in JavaScriptCore
by tambourine_man on Wednesday July 29, 2020 @05:59PM
(#23992051)
This 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.
Large 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.
Re:Speculation in JavaScriptCore
by tambourine_man on Wednesday July 29, 2020 @08:31PM
(#23993088)
Browser 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.
Python?
Re:Speculation in JavaScriptCore
by pizlonator on Wednesday July 29, 2020 @03:51PM
(#23990865)
And let’s not forget HHVM. That was (is?) quite the beast.
Re:Speculation in JavaScriptCore
by jashmatthews on Wednesday July 29, 2020 @10:08PM
(#23993655)
LuaJIT 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
Yes, I suppose "in the same way earlier versions of LuaJIT worked" would be more accurate.
Re:Speculation in JavaScriptCore
by jashmatthews on Wednesday July 29, 2020 @10:38PM
(#23993891)
LuaJIT 1.x was also an enormous disappointment so it’s a bit perplexing that the PHP team would try something which probably sucks.
Don'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++.
Underappreciated comment and upvoted.
Re:Speculation in JavaScriptCore
by pastrami_panda on Wednesday July 29, 2020 @04:57PM
(#23991519)
> most of what people do with PHP isn't CPU bound
... cause it's I/O bound? Just curious.
Re:Speculation in JavaScriptCore
by pizlonator on Wednesday July 29, 2020 @04:59PM
(#23991540)
I 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.
Versus PHP5.x that's true. Mostly because the PHP internals were inefficient. The performance differences vs HHVM vanished with PHP 7.x.
Re:Speculation in JavaScriptCore
by jashmatthews on Wednesday July 29, 2020 @08:02PM
(#23992900)
HHVM'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.
I 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.