Quick Comparison of a few popular Java Frameworks

After listening to the progammier.bar podcast about the state of Java in 2022, I was impressed by the statements made by the podcast guest.

The podcast is in German, though. Here is the link to the episode: https://www.programmier.bar/podcast/deep-dive-112-why-java-rocks-mit-adam-bien

Especially the claimed startup times and low memory consumption that Adam Bien mentions surprised me. That did not match my usual experiences. To look into this, I created some super-simple services with Quarkus, Micronaut and Spring Boot (both synchronous and reactive).

The following tests and comparisons shall only be used to get a feeling on what is possible and what the differences are between frameworks. I started each service a few times on my local computer and observed the startup time and memory consumption.

The applications used for this test are dead simple. All have just one single endpoint which accepts GET requests without parameters and returns a static string.

For Spring Boot MVC, the controller code looks like this:

1
2
3
4
5
6
7
8
@RestController
public class Controller {
    
    @GetMapping("/hello")
    String hello() {
        return "Hello Demo";
    }
}

Results

All in all, I am quite impressed by the Java performance. For me, a Java Spring Boot service is usually large and takes dozens of seconds to start up. Of course, my experience is based on more complex services with dependencies such as databases, message queues, etc. These simple examples proof that Java-based services can also be light-weight and start quickly is under a second, given the services are not too complex.

FrameworkSpring Boot
(webmvc)
Spring Boot
(webflux)
QuarkusMicronautactix-web
(Rust-based)
Version2.7.52.7.52.13.33.7.34.2.1
Bundle Size17 MB19 MB14 MB14 MB4.4 MB
Physical Memory235 MB240 MB106 MB119 MB4 MB
Used Heap15 MB14 MB11 MB14 MB?
Startup Time~ 890 ms~ 880 ms~ 340 ms~ 350 m?

Note that the actix-web example is not a Java application. It is build with Rust. The generated bundle (or executable) is statically linked, thus, no JVM required to run the application. 4.4 MB is the total size of the application.