Reputation: 5596
IIUC, GraalVM project provides new JIT compiler which should work with any JVM distribution (OpenJDK, Oracle, Amazon Corretto) however, GraalVM website also provides bundled downloads which are based on OpenJDK. So, what's the difference between using Graal JIT with other distributions VS using Graal's own distribution? Does Graal further optimizes JVM in their own distribution?
Upvotes: 2
Views: 1317
Reputation: 3234
The new JIT compiler should work with any JVM that implements JEP243 Java-Level JVM Compiler Interface, which is implemented only by HotSpot JVM at the moment. The GraalVM team provides backports of it to open/oracle JDK8 and it is included in JDK9 and later. For other distributions (Amazon, etc.) it depends on what HotSpot version they are based off.
You can run Graal Compiler that is bundled with JDK9+ by using these options (I think it works only on Linux):
-XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -XX:+UseJVMCICompiler
You're going to have an easier time using GraalVM as everything is set-up there already and you get the newest GraalVM Compiler. On top of that, GraalVM provides additional features like native-image for faster startup and low memory footprint of Java programs, dynamic languages like JavaScript, Python, Ruby, and R, and more. Moreover, there is an enterprise edition of GraalVM that, among other things, contains further optimizations.
References:
https://www.graalvm.org/ for more details on the features
https://renaissance.dev for benchmarks of both community and enterprise versions of GraalVM
Upvotes: 4