4 ms·
JSC has four in the sense that hot enough functions go through LLInt, then Baseline, then DFG, and then FTL. They go through three lower optimization levels bef
by pizlonator 6y ago
JSC has four in the sense that hot enough functions go through LLInt, then Baseline, then DFG, and then FTL. They go through three lower optimization levels before the max one.
HotSpot has three in the sense that you get interpreter, client, then server.
Both VMs have additional execution engines available behind flags. JSC has a different interpreter (CLoop, based on LLInt but different) for some systems, so it’s like a “fifth tier” if you think of “tier” as just an available execution engine. I think of tier as a stage of optimization that you get adaptively, without having to specifically configure for it. I get that HotSpot can alternatively AOT or Graal, but those aren’t tiered with the rest to my knowledge (like there is no interpreter->client->server->graal config but if there was then that would be four tiers).
- monocasa 6y agoHotSpot definitely uses five tiers (including the interpreter, so same as JSC). https://github.com/openjdk/jdk/blob/0aefe6f20ae719c9793c790dbf5993a6edd9a746/src/hotspot/share/compiler/tieredThresholdPolicy.hpp#L37 https://github.com/openjdk/jdk/blob/0aefe6f20ae719c9793c790d... I'll give you that levels 1-3 use the same IR, but that says more about the generality of the C1 IR than JSC being more advanced for using different IRs IMO.
- chrisseaton 6y agoI don't think it's reasonable to describe those as five independent tiers. Two of them just add (slower) code to collect profiling information.
- pizlonator 6y agoAccording to that, it skips level 1 and goes all the way to 3 in some cases. Again, not the same as what JSC does, and not nearly as aggressive. Most notably, there is no baseline jit. Also, C1 in any config compiles slower than DFG.
- monocasa 6y agoDid you edit out where you had said "JSC > Java" in your initial reply? That really colors the conversation in a different way retroactively that I don't really appreciate. It now looks like I'm berating you out of nowhere, when really you originally made an assertion and I'm just trying to get you to back it up.
- pizlonator 6y agoYou started by claiming that Azul is more advanced. You got snark. Maybe it’s more advanced at collecting garbage or supporting threads, but it is not comparable in the field of type inference, because Azul’s VM and other JVMs do not do any of the kind of type inference described in this post. And no, invokedynamic is nothing like inline caching for JS - not even close. Most of this post is about what type inference for dynamic languages really looks like when you invest HotSpot-like efforts to that specific problem. Saying that Azul is more advanced at type inference is far off from the truth at a very fundamental level. So I gave you snark. Being snarky is fun sometimes!
- saagarjha 6y agoPerhaps, but not for Hacker News: https://news.ycombinator.com/newsguidelines.html https://news.ycombinator.com/newsguidelines.html
- pizlonator 6y agoAnyway, this is silly. The post cites HotSpot and it’s predecessors. It’s just not the case that we repeat their technique, and number of tiers is a snarky difference and not the real one. I’m not going to give you a TL;DR that enumerates the meaningful differences just because you claimed that there aren’t any.
- iainmerrick 6y agoThey were asking for one good example of an innovation over HotSpot, not an enumeration of all the differences. That seems like a reasonable request! The “number of tiers” difference doesn’t seem quite substantive enough, I would say, although I’m definitely no expert.
- pizlonator 6y agoIf you want a good example then read the post. You’ll find many. It’s not the purpose of this post to enumerate differences to HotSpot, but it does show some cases where the two approaches are alike.