Accelerating Java performance
GraalVM’s high-performance JIT compiler generates optimized native machine code that runs faster, produces less garbage, and uses less CPU thanks to a battery of advanced compiler optimizations and aggressive and sophisticated inlining techniques. The end results are applications that run faster and consume fewer resources—reducing cloud and infrastructure costs.
Figure 1. Speedup vs OpenJDK 11
The size of the speedup depends on the type of workload. On the Renaissance benchmark suite, which “contains a range of modern workloads, comprising of various popular systems, frameworks and applications made for the JVM”, Oracle GraalVM achieves a geomean speedup of 1.55x over OpenJDK 8 and similar results for OpenJDK 11.
Oracle Cloud Infrastructure
By running the Oracle Cloud Infrastructure (OCI) Monitoring (telemetry) service on Oracle GraalVM, a 10% transaction processing rate increase was achieved along with a 25% reduction in garbage collection times, a 17% reduction in GC pause times, and a 5% reduction CPU utilization. These improvements have significant benefits for a memory intensive service that routinely processes tens of millions of data points, ingests billions of metrics, and serves millions of requests coming from an ever growing collection of OCI service offerings.
Figure 2. OCI Monitoring Service Throughput (transaction per second)
Lower infrastructure costs
Higher application performance and lower CPU and memory usage are goals every developer strives for. These goals are definitely laudable, and achieving them is easier with GraalVM, but the real value of these improvements is a reduction in the cost to run an application in production. Faster applications with lower resource requirements translate into fewer servers required to deliver a given service, and fewer servers means lower monthly cloud bills and lower capital and operating costs for on premises deployments.
The math is straightforward. Even with no reduction in resource requirements, with just a ~11% improvement in throughput, 9 servers can do what required 10 before. That is one less cloud server to pay for or one less datacenter server to buy and maintain.
Oracle GraalVM was the performance choice for our Dell EMC Servers. Java workload analysis and SPECjbb®2015 benchmark improving max-jOPS results by almost 8%.
Something to Tweet About
Twitter is one of the most popular social media services in the world running a platform used by millions of users around the globe daily. To keep costs down and performance up, Twitter relies on GraalVM to run core services like Tweet, Social, and News. With the efficiency of the GraalVM JIT compiler, Twitter is able to meet their throughput targets with fewer servers, resulting in significant savings.
Being able to see 8–11 percent performance improvements on the same hardware without having to change the underlying code is a once-in-a-lifetime event, leading to substantial cost savings and future flexibility for Twitter.
Better performance with no code changes
While the OpenJDK project moves forward with the 6-month release cadence, which offers time-based release model where features get in whenever they are ready, a large part of the Java ecosystem is still using Java 8 and Java 11 in production.
GraalVM’s dedication to improving the Java ecosystem comes with support for those major versions which are the most popular. GraalVM includes a compatible JDK and currently offers downloads based on Java 8 or Java 11. To use GraalVM to speed up Java applications, build native executables with the Native Image feature, or incorporate libraries from other languages, you do not have to undergo complex migrations to the latest OpenJDK release. Migrating services to GraalVM mostly consists of replacing the JDK downloads or base container images with the GraalVM based ones without code changes or needing to leverage new language features!
Equally excellent developer productivity
One of the best features of GraalVM is its compatibility with all the tools in the Java ecosystem. GraalVM can run Java applications offering better performance without code changes or any learning curve for developers. GraalVM fits into your workflow, being a compatible JDK it not only runs the applications you are working on, but the Java tools that help you! GraalVM works in your debugger, works with your build tools, it works within your favourite IDE, you can migrate your continuous integration environment to it, run your issue tracker on it and all other Java services you are using.
You do not even have to be a Java developer! If other JVM languages are your cup of productivity, that is okay. From Kotlin, to Clojure, to Scala, GraalVM can help you run them all with excellent performance too.
GraalVM merges the power of the Java ecosystem and community with a more powerful JDK distribution for the best of all worlds.
Supported by industry-leading Java application frameworks
Supported by industry-leading Java application frameworks, GraalVM is often cited as the most exciting innovation in the Java ecosystem. For example, the ability to compile applications into native executables with the Native Image technology revolutionises cloud deployments for Java applications. It is especially important for microservices where individual services are either neatly packed in environments constrained by memory or quickly become a major part of the cloud cost. Luckily, with GraalVM you do not have to rewrite your applications in Go to succeed in the cloud. Most major Java application and microservice frameworks are designed with GraalVM Native Image in mind or are working on adding first-class support.
Micronaut, Helidon, Quarkus, or Spring Boot for microservices, PicoCLI for command line applications – whichever task you are facing, there’s a GraalVM Native Image compatible framework available to make your job easier.
Expanding the Java ecosystem
The Java Virtual Machine (JVM) makes it possible to run Java programs on everything from small embedded devices to mainframes. It is a high-performance runtime that abstracts away the details of underlying hardware and operating system platforms to enable code portability. But it turns out the JVM does not actually know anything about the Java language itself as it executes programs compiled to the intermediate Java bytecode format. This means that any language that can be compiled to Java bytecode can be run on the JVM, for example, Scala, Kotlin, and Clojure. However, there are many popular languages that do not compile to Java bytecodes and cannot take advantage of the benefits provided by the JVM and the performance benefits of just-in-time compilation.
TruffleRuby has high potential in speed, as it is nine times faster than CRuby on optcarrot.
Figure 4. GraalVM Truffle Languages
Breaking Down Walls
GraalVM’s multilingual support makes it possible for developers with different language and domain expertise to collaborate. For example, the Dutch National Police used GraalVM to integrate R code into Spring Boot web services written in Java and Scala. This allowed their data scientists to write code in R to perform data analysis while their Java and Scala developers built out services that interacted with Apache Kafka.
Embedding R code in a Scala/JVM project can be an excellent way to use the powerful data processing packages accessible in R… This means you (or your Data Scientist) can use a specialized editor (e.g. RStudio) to create the R side of your functionality, while you can use your own favourite editor for the JVM side (e.g., IntelliJ).