Performance testing Quarkus applications

In this post, we will be comparing the performance of our Quarkus application in 2 scenarios.
- When we run it as a native executable.
- When we run it in the JVM.
Memory usage
On the Quarkus official website, Quarkus promises a huge improvement on memory usage.

Running the application on a Windows machine as a native executable felt light, but I wanted to prove that with some data. Let's take a look at the task manager and see how much memory the process uses:

So I was kind of right. 20MBs only! Now let's compare that to running the same app using the JVM:

301mb vs 20mb for the native executable! That is very impressive, I would say.
Startup time
Another metric that I wanted to check is startup time. Running the service as a native executable took ~1 second to start, while running it in the JVM took about 3.4 seconds.
REST API metrics
When running REST APIs, one of the most important performance metrics is latency. API latency is the total amount of time that it is taken by an API system to respond to an API call, so it is very important to decrease this amount and keep it as low as possible.
To perform this test, I will be using JMeter. Apache JMeter is an Apache project that can be used as a load testing tool for analyzing and measuring the performance of a variety of types of services. I will test the service by creating a thread group representing 10 simultaneous users, each firing 10 requests within 10 seconds.
Let's check the results of running the test plan on the Quarkus application running in the JVM:

We can notice that the latency varies between 3 and 193 milliseconds for 100-121 bytes of load. Let's execute the same test plan on the native application:

Now, the latency varies between 6 and 1 milliseconds! That is a huge performance improvement for our API!
Before writing this post, I doubted the added value of using Quarkus for developing Java applications. After seeing all the improvements it brings to the table like the live development environment, the ease of use and the performance gains, I would say it is worth giving a shot!
Imagine the productivity boost of your development teams when they use the live-reload environment. Imagine how much costs you would save running hundreds or thousands of such services since they need less memory/CPU power. And eventually, imagine how your customers would be happier when the response times of your API decrease and your application become faster and faster.
Thank you for reading my blog. Please make sure to check out the other Quarkus related articles by visiting the Quarkus section of my blog.