Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Worth noting that this basically means that all of the JS engines are converging on what JavaScriptCore pioneered:

- More than just two tiers (JSC has four, and I guess Moz has four too now; I guess it's just a matter of time before V8 follows).

- Bottom tiers must include a fast interpreter that uses JIT ABI and collects types (Ignition and this Moz interpreter smells a lot like JSC's LLInt, which pioneered exactly this for JS).

It's weird that they kept the C++ interpreter. But not too weird, if the IC logic in the new interpreter is costly. In the LLInt, the IC/type logic is either a win (ICs are always a win) or neutral (value profiling and case flag profiling costs nothing in LLInt).

Also worth noting that this architecture - a JIT ABI interpreter that collects types as a bottom tier - is older than any JS engine. I learned it from HotSpot, and I guess that design was based on a Strongtalk VM.

This is the current state of the art of JSC's bottom interpreter tier FWIW: https://webkit.org/blog/9329/a-new-bytecode-format-for-javas...



And also the way Java and .NET are converging, by having both AOT/JIT on the box, alongside JIT caches.

There is also the whole ART reboot, where Google made the mistake of not doing AOT the same way as Microsoft did for the Windows Store, by compiling on the device instead of the more beefy store cluster, so they ended up with a mix of fast interpreter written in straight Assembly, a first tier JIT with PGO, and an AOT compiler that takes PGO profiles and really optimizes the critical paths while the device is idle. This circle goes around every time the application is updated or PGO information gets invalidated.

Likewise .NET Native had a few issues with reflection, so .NET Core 3.0 is bringing mixed AOT/JIT into the mix, with further improvements planned for .NET Core 5.

And on the Java world, after a couple of decades with separate AOT (comercial) and JIT toolchains, also the more widespread JDKs are going with both.

So everything new is old again, given the AOT/JIT experiments from Smalltalk, Eiffel, Oberon and Lisp. :)


Hi @pizlonator, the link you posted mentions that direct threading isn't needed anymore.

I would have expected the Meltdown/Spectre mitigations to penalize indirect branches, making direct threading relevant again. From that post, I suppose it isn't the case, but I'd love to know more about it.


JavaScriptCore uses indirect branches just as it did before Spectre.

Also, direct threading still means doing the same number of indirect branches as before, unless you implemented it as a tree of conditional branches. So direct threading doesn't change the Spectre situation one way or another.


Are there any solid benchmarck comparing JSC vs v8?


JSC has had a set of large metabenchmarks like JetStream2 for a while. We have been the fastest for a while but V8 is gaining, so the current advantage is significant but not earth shattering.

The last time V8 had their own benchmark, they retired it right after we beat them on it and made a post saying that benchmarks are bad because people cheat on them.

Around that time I stopped seeing google.com claim that I should switch to Chrome “because it’s faster”.

So basically JSC is fast enough to have made V8 ragequit benchmarking. Hope that answers your question!


JSC is barely ever mentioned in the v8 team. They gave up wanting to be benchmark kings in the interest of having decent performance in Android markets (low-end and high).

Comments around cheating are likely aimed at OEMS who ship Chrome derived browsers and spin up the clock frequency when they detect certain benchmarks are running. These look great in online reviews.


I've always wished I could actually benefit from JSC without dropping a couple thousand dollars on a macbook and having to put up with the world's worst keyboard, because your browser team kicks ass :)

At least you're pressuring Mozilla and Google to step up their game on runtimes!


it's not Mac exclusive. WebKitGTK uses JSC too


> ragequit

I've increased my vocabulary today.

In topic: I always wondered why chrome stopped that marketing spiel.


I found https://webkit.org/blog/8685/introducing-the-jetstream-2-ben..., with a graph at the end, but of course that is written by Webkit (JSC) developers. Then there is https://johnresig.com/blog/javascript-performance-rundown/ from 2008. https://www.railsmine.net/2017/12/browser-benchmark-safari-1... from 2017, similar results to the JetStream 2 post.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: