In order to gain the performance benefits offered by GraalVM, the application must be compiled using GraalVM's compiler. However, what's not clear to me is whether the application must also be executed by GraalVM, or whether it can be deployed to a "regular" VM (e.g. OpenJDK) in order to benefit from the improved performance?
Some additional details which may be relevant
If you have compiled your code with JVM Runtime mode, than you can run your application on any JVM. There is no compulsion of running the application with GraalVM.
If you have compile your code with Native Image compiler, than it will create a native executable binary which can be directly executed without usage of any JVM.
GraalVM is based on OpenJDK with some extras; one of them is a state-of-the-art compiler.
The Graal compiler is very versatile; it is used to compile native images (AOT mode) but can also be used as a JIT compiler, replacing C2, which is the default shipped in OpenJDK.
The term compiler is a bit overloaded in this case. The traditional Java "compilers" e.g. javac/ecj, compile Java sources to bytecode. The "optimizing compilers" e.g. Graal and C2, compile bytecode to highly optimized assembly.
GraalVM uses a different "optimizing compiler" (Graal), which may indeed give some speedup compared to a vanilla OpenJDK (C2) but that's very dependent on your workload, you should always measure yourself.
Additional reference: Twitter's Quest for a Wholly Graal Runtime by Chris Thalinger
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With