GraalVM 22.3 Boosts Native Image and Compiler Features for Java, JavaScript, Ruby, Python, and WebAssembly
Oracle’s latest update to GraalVM, version 21.2, introduces significant enhancements to both the compiler and native image capabilities, expanding its high-performance, multi-language runtime offerings.
Released on July 20, GraalVM 21.2 is available in both community and enterprise editions. The update features various improvements aimed at optimizing the performance of the GraalVM compiler. Notably, it includes enhanced loop limit analysis for counted loops, enabling the compiler to better analyze control flow preceding these loops and optimize induction variables more effectively. This advancement makes it possible for more uncounted loops to benefit from advanced compiler optimizations. Additionally, the compilation of code utilizing common StringBuilder patterns has been refined, with better support in JDK 11-based GraalVM builds due to the inclusion of compact string support introduced in JDK 11.
For the community edition, new optimizations include speculative guard movement, which attempts to move loop-invariant guards outside of loops to enhance performance for relevant workloads. Improvements to safe-point elimination in long counted loops have also been implemented, aiming to streamline execution further. Experimental features like write sinking optimization attempt to move writes out of loops, and SIMD vectorization for sequential code is available in the enterprise edition, although it is not yet enabled by default.
GraalVM continues to serve as a high-performance runtime for a diverse range of languages, including Java, JavaScript, LLVM-based languages such as C and C++, and dynamic languages like Python and Ruby. Enhancements to Native Image capabilities have been a key focus, with recent updates including Gradle and Maven plug-ins released in June that support JUnit 5 testing. These plug-ins simplify the process of building native images for applications and enable running JUnit tests in native image mode, ensuring compatibility and functionality.
The GraalVM 21.2 update also brings improvements to Native Image functionalities. Native Image now automatically detects and removes unnecessary security providers, thanks to enhanced static analysis. Furthermore, an implementation of class pre-definition has been introduced, allowing ClassLoader.loadClass calls to work at runtime. This means that classes required at runtime must be available to the static analysis at build time, but code patterns involving the loading of classes at arbitrary moments are now supported. Additionally, native images built with the -H:+AllowVMInspection flag can now record Java Flight Recorder (JFR) events, providing more comprehensive profiling and monitoring capabilities