Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ


Choose your language

InfoQ Homepage News GraalVM 21.2 Improves Native Components

GraalVM 21.2 Improves Native Components

This item in japanese

Lire ce contenu en français

GraalVM 21.2 has been released to speed up native compilation times, and improve integrations with JDK flight recorder as well as improve support for non-Java languages like Ruby and JavaScript.

The release simplifies the role of testing duplication between an application’s features when acting in HotSpot mode (a TCK compliant runtime) versus native image compilation (platform-native binary). The benefit to the native compilation is a reduced startup time and lower memory consumption, as well as the ability to run on different platforms like iOS and Android.

Support for native testing appears as part of the Gradle and Maven plugins that run additional tests on an application to validate that the functionality of a native image matches the expectations of HotSpot mode. This test plugin offers similar functionality to tools like Quarkus that leverage GraalVM and Mandrel (RedHat’s GraalVM) testing when a native image is created.

When native-compiling a Quarkus application, developers can leverage an additional @NativeImageTest annotation, extending an existing unit test class to run before and after native compilation. The duplicate testing occurs because the running application is slightly different: a failure before native compilation will prevent the wasted time of compiling an incorrect application and a failed test after will demonstrate that the functionality of the native version differs from the HotSpot version.

Developers of native applications can now monitor performance events through OpenJDK Flight Recorder using events that are written in Java, similar to what they would expect with these events on a HotSpot JDK. Custom events can then be viewed in tools like JDK Mission Control (the viewer companion to JFR) or major dashboard tools like New Relic One.

Additional performance improvements were made to the underlying polyglot languages, as GraalVM provides a common runtime and JIT that supports many languages at once. Through the Truffle language framework, GraalVM offers support to compile and run applications in Python, Ruby, R, Cuda, and many others.

The capabilities of GraalVM native compilation appear in a mix of different JVMs that enable developers and operators to take full advantage of different types of hardware:

  • Standard HotSpot JVMs (the most common) offer just-in-time compilation with optimal peak performance to run across modern systems (x68/x86_64), cloud, and many embedded cases (various ARM chips).
  • GraalVM/Mandrel offers a HotSpot mode as well as native compilation to run on mobile devices (iOS and Android) as well as favoring just-in-time compilation for ahead-of-time compilation on smaller ARM embedded devices.
  • TornadoVM offers similar capabilities targeted more toward execution on GPUs rather than CPUs. TornadoVM shares some similar capabilities in concert with GraalVM, as both perform native compilation.

Developers interested in the new capabilities can download the latest GraalVM Community Edition or in future versions of RedHat Mandrel.

Rate this Article