Oracle's GraalVM adds Native Image, compiler enhancements

Oracle's GraalVM adds Native Image, compiler enhancements

Upgrade to the high-performance, multi-language runtime also offers improvements for Java, JavaScript, Ruby, Python, and WebAssembly.

Credit: Dreamstime

Oracle’s latest update to the GraalVM multi-language runtime offers compiler and native image usability improvements, along with enhancements geared to specific languages.

GraalVM 21.2, published July 20, is available among community and enterprise editions from the project website.

For the compiler, the update features optimisations including improved loop limit analysis for counted loops, enabling the compiler to analyse control flow preceding the loop to reason about induction variables. This can make more uncounted loops amenable for advanced optimisations.

Compilation of code using typical StringBuilder patterns also has been improved, with enhanced support for these patterns in JDK 11-based GraalVM builds due to awareness of compact strings in JDK 11.

In the community edition, a speculative guard movement optimisation has been added, which attempts to move a loop invariant guard from inside a loop to outside a loop to improve relevant workloads. Safe-point elimination mechanisms in long counted loops also have been improved.

An experimental write sinking optimisation tries to move writes out of loops. A novel SIMD vectorisation for sequential code is available in the enterprise edition but is not yet enabled by default.

GraalVM attempts to provide a high-performance runtime for Java, JavaScript, LLVM-based languages such as C and C++, and dynamic languages such as Python and Ruby. For Native Image capabilities in GraalVM, Gradle and Maven plug-ins were released in June with JUnit 5 testing support, to simplify building native images of applications and allowing JUnit tests to run in native image mode, to check how code works there.

Native Image now automatically removes unnecessary security providers from the image; reachable security providers are detected by the static analysis. With GraalVM 21.2, an implementation of class pre-definition supports Classloader.loadClass calls at run time.

Desired classes that need to be loaded at run time must be made available to the static analysis at build time so they are included in “real world” analysis, but otherwise code patterns that include loading classes at arbitrary moments of run time now are working in native images as would be expected. Also with GraalVM 21.2, native images built with -H:+AllowVMInspection now support JFR (Java Flight Recorder) events written in Java.

Other new features and improvements in GraalVM 21:2 include the Truffle language implementation framework, which works with GraalVM, has a new compilation queuing heuristic to improve the warmup time of the polyglot runtime on many workloads. This is enabled by default.

A HotSpot plug-in API for Java on Truffle allows code to evolve naturally during development without having to restart a running application while the JavaScript implementation adds recent proposals such as new set methods and experimental operator overloading.

For Ruby, GraalVM 21.2 adds compatibility and performance improvements including precise invalidation for Ruby methods and constants, using per-name and per-class assumptions. For Python, a faster version of _pickle is featured for quicker serialisation.

In addition, C++ virtual calls are supported via cross-language interoperability and WebAssembly compatibility improvements have been made.

Follow Us

Join the newsletter!


Sign up to gain exclusive access to email subscriptions, event invitations, competitions, giveaways, and much more.

Membership is free, and your security and privacy remain protected. View our privacy policy before signing up.

Error: Please check your email address.

Tags Oracle



Show Comments