Skip to content
0:00 / 0:00

#jit#aot#hotspot

Runtime vs. compile time (JIT vs. AOT) optimizations in Java and C++ - Ionut Balosin

Devoxx

172K subscribers • 64 videos on Hallway • Conference channel

YouTube
  • Recommended by 1 person: 1 in engineering communities.
  • Presented by Ionut Balosin

Advanced. Deep dive for people who know the field.

6.1K views8 years ago1 recommendation

Systems programmingProgramming languagesCompilers and interpretersPerformance and optimizationJava and the JVM

Ionut Balosin compares runtime optimizations in the HotSpot JIT compiler with ahead-of-time optimizations in LLVM Clang.

During this talk I present my research study in regards to several runtime optimizations done by Just In Time Compiler inside HotSpot/OpenJDK versus the one similar triggered in an ahead of time time manner by LLVM clang in C++.

Why it's here

1 person recommends this

What people say. Recommended for its detailed comparison of HotSpot C2 and LLVM compiler optimizations.

u/pron98in r/programming • Recommends

On “Why is “2 * (i * i)” faster than “2 * i * i”? (JAVA)”

HotSpot's C2 compiler actually does vectorize loops, but not in this particular case of a sequential reduction, where the optimization was specifically disabled, as it was deemed not beneficial enough; re-enabling it is an open issue. See this talk for a comparison of C2 and clang optimizations.

u/pron98in r/programming • Recommends

On “Why is 2 * (i * i) faster than 2 * i * i in Java?”

The compiler discussed here (C2) happens to be a JIT. Now, LLVM and HotSpot's top-tier compilers, C2 and Graal, are all state-of-the-art. See some comparisons here; basically, neither C2 nor LLVM dominates. As others mentioned, Azul are using LLVM as a top-tier JIT called Falcon in HotSpot, as well. Quite a few languages simply cannot be compiled AOT efficiently (e.g. JavaScript). Many of those that can (like Java), still benefit considerably from a JIT, as it can optimize more aggressively than an AOT (given finite resources). Pretty much the only languages that don't benefit much from JIT compilation are those that require the programmer to choose compiler optimizations at almost every…