Skip to content

ivangfr/web-reactive-jvm-native-cds-aot-virtual-threads

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

web-reactive-jvm-native-cds-aot-virtual-threads

License: MIT Buy Me A Coffee

In this project, we will create six applications using Spring Boot, Quarkus, and Micronaut frameworks.

For each framework, we will implement one app with traditional blocking Web using Apache Tomcat and another app with non-blocking Reactive using Netty. We will also build both JVM and Native Docker images for the applications.

For the Spring Boot apps, we will build additional Docker images with different configurations, including enabling or not some Java optimizations like Virtual Threads (JEP 444), CDS (JEP 310), and AOT (JEP 295).

Proof-of-Concepts & Articles

On ivangfr.github.io, I have compiled my Proof-of-Concepts (PoCs) and articles. You can easily search for the technology you are interested in using the filter. Who knows, perhaps I have already implemented a PoC or written an article about what you are looking for.

Additional Readings

Spring Boot Performance Benchmark

Java Frameworks Performance Benchmark

Applications

Latest Framework Version Used

Framework Version
Quarkus 3.31.1
Micronaut 4.10.7
Spring Boot 4.0.2

Thread Configuration for Web Apps

For fair benchmark comparison, the blocking Web MVC applications (spring-boot-greetings-api-web, quarkus-greetings-api-web, and micronaut-greetings-api-web) are configured with 200 threads:

Framework Configuration Property Default (without config)
Spring Boot Tomcat default 200
Quarkus quarkus.thread-pool.max-threads=200 Math.max(8×CPU, 200)
Micronaut Tomcat default 200

This ensures all three frameworks use the same number of worker threads during benchmarks.

Virtual Threads Configuration for Web Apps

Virtual threads are disabled in all blocking applications Web MVC applications (spring-boot-greetings-api-web, quarkus-greetings-api-web, and micronaut-greetings-api-web) to ensure fair benchmark comparison. The table below shows the default virtual threads setting for each framework:

Framework Virtual Threads Configuration
Spring Boot Disabled by default -
Quarkus Disabled by default -
Micronaut Enabled by default micronaut.servlet.enable-virtual-threads=false

This ensures all three Web applications use regular platform threads (200 max by default) during benchmarks.

Prerequisites

Docker Images

The application's JVM and native Docker images can be found at this Docker Hub link.

Bash scripts

  • build-docker-images-spring-boot.sh: script to build Spring Boot Docker images
  • build-docker-images-quarkus.sh: script to build Quarkus Docker images
  • build-docker-images-micronaut.sh: script to build Micronaut Docker images
  • remove-docker-images.sh: script to remove all Docker images

Support

If you find this useful, consider buying me a coffee:

Buy Me A Coffee

License

This project is licensed under the MIT License.

About

In this project, we’ll create six apps using Spring Boot, Quarkus, and Micronaut. For each framework, one app will use blocking Web with Tomcat, and the other will use non-blocking Reactive with Netty. We’ll build both JVM and Native Docker images. For Spring Boot, additional images will test configurations with Virtual Threads, CDS, and AOT

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

  •  

Packages