- For Java Programs
- For Node.js Programs
- For Ruby, R, or Python
- For Microservices Frameworks
- For Your Platform
- For Your Languages and Tools
For existing Java applications, GraalVM can provide benefits by running them faster, providing extensibility via scripting languages, or creating ahead-of-time compiled native images.
GraalVM can run in the context of OpenJDK to make Java applications run faster with a new just-in-time compilation technology. GraalVM takes over the compilation of Java bytecode to machine code. In particular for other JVM-based languages such as Scala, this configuration can achieve benefits, as for example experienced by Twitter running GraalVM in production.
The compiler of GraalVM provides performance advantages for highly abstracted programs due to its ability to remove costly object allocations in many scenarios. You can find details in this research paper and try an example. Better inlining and more aggressive speculative optimizations can lead to additional benefits for complex long-running applications, see a Stream API example.
Whether and how much of a difference GraalVM makes in terms of performance depends of course on the concrete workload. We are interested in receiving any kind of benchmarking results that can help us make GraalVM even faster.
Running your application inside a Java VM comes with startup and footprint costs. GraalVM has a feature to create native images for existing JVM-based applications. The image generation process employs static analysis to find any code reachable from the main Java method and then performs full ahead-of-time (AOT) compilation. The resulting native binary contains the whole program in machine code form for its immediate execution. It can be linked with other native programs and can optionally include the GraalVM compiler for complementary just-in-time (JIT) compilation support to run any GraalVM-based language with high performance. For additional performance, native images can be built with profile guided optimizations gathered in a previous run of the application. See an example of how to build native images here.
Warning: Support for Ruby, R, or Python is experimental in GraalVM.
We are actively working on stability and support for all modules for those languages. At this point in time, we can run simpler applications of Ruby and R, but we do not have the same full compatibility we provide for Java and Node.js applications. Our Python implementation was just recently started and can only run small examples.
GraalVM Native Image, currently available as an Early Adopter technology, works with many different Java microservices frameworks.Several projects have already accepted this technology as a platform for theirapplications: Quarkus, Micronaut, Helidon. For these frameworks GraalVM nativeimages significantly reduce the runtime memory requirements compared to runningon HotSpot. We believe that GraalVM Native Image technology can become the bestway for deploying cloud native applications.
We encourage the development of GraalVM embeddings similar to our ownintegrations in the Oracle Database, OpenJDK, or Node.js. Together with researchcollaboration partners, we already explored ideas of embedding in Spark orFlink. Find a description on how to embed GraalVM in your existing JVM-basedapplication or native application here.
GraalVM is an open ecosystem and we invite third party systems to participatevia connecting their own programming languages, tools, or platforms.
The Truffle Language Implementation framework allows running programming languages efficiently on GraalVM. It simplifies language implementation by automatically deriving high-performance code from interpreters. You can find details about the approach in this research paper.
Implementing your own language using GraalVM will not only give you high performance. More importantly, it allows your language to connect with the rich tooling provided by the GraalVM ecosystem. Also, it enables your language to run in the context of any GraalVM embedding.
We developed a demonstration language called “SimpleLanguage” to show the use of GraalVM’s language implementation framework. Find out how to get started implementing a language.
GraalVM provides a framework for creating language-agnostic tools like debuggers, profilers, or other instrumentations. GraalVM provides a standardized way to express and run program code enabling cross-language research and the development of tools that are developed once and then can be applied to any language.