Under the hood of the JVM

A weekly podcast with Cliff Click talking about all things to do with programming, programmers and computer performance.

This is a short talk on what’s under the hood of the JVM.



4 thoughts on “Under the hood of the JVM

  1. So glad I found your podcasts, Cliff! You answered pretty much all the questions I’ve asked you on Quora (and more) just in this one alone.

    Personally, I’d love to hear more about the nuts and bolts of JITing. I understand many of the most common optimizations, but have to admit the analysis part is rather opaque to me.

    I wonder how the analysis techniques used by HotSpot compare to “whole program analysis” in compilers like MLton and Stalin. Despite the obvious difference in scope, there seems to be a commonality in using dynamic analysis (e.g. tracing) to identify “heroic” optimizations.

    • Yeah, that’s a “longer” subject, as in there are dozens of PhDs on how to break up compilation vs whole compilation, the speed improvement of resulting programs, the compilation times increase and so on. Might make a good “light touch” Podcast, but to get into the details you probably need a grad compiler course or two under your belt.

      • Hmm. I’m probably not at the “or two” level. I’ve written toy compilers because, after all, it’s pretty easy to write a compiler (and even a VM) if you skip the optimization stage 🙂

        Anyway, since commenting here I read this great paper on optimizing Scala code with Graal: “Making collection operations optimal with aggressive JIT compilation” (https://dl.acm.org/citation.cfm?doid=3136000.3136002). When presenting it one of the authors commented on the tradeoff between whole program analysis and tracing JITs and how he likely sees the future being a combination of both.

        I would guess based on the timeline that you’re not up on Graal? If you do have any thoughts on it, or even things like the Nanopass framework or Futamura projections, I think that could make a great podcast. Or on the lighter side, maybe a bit on HotSpot’s Tiered Compilation? In other words, starting with the “when” it decides to apply heroic optimizations rather than the how.

        • When to “heroic opt”? When you have enough info to determine the opt fail-rate is low enough to get a payback. It’s actually fairly straightforward math, but it does require collecting some stats. You also need “when to STOP doing this heroic opt” which generally requires recording more stats. We started with simple things with obvious gains and obvious recoveries, and got more sophisticated with time.

Leave a Reply

Your email address will not be published. Required fields are marked *