r/java • • 21h ago

Benchmarking Java frameworks on a 512 MiB server: Spring Boot, Quarkus, Micronaut and Jex

Post image
42 Upvotes

I've been experimenting with Java applications on memory-constrained servers and have now formalized these comparisons into a reproducible benchmark.

One particularly interesting finding: despite substantial differences in memory consumption and startup time, all four stacks delivered remarkably similar p99 latency under sustained load.

The first published results compare four stacks implementing the same investment portfolio service:

  • Spring Boot + JDBC
  • Quarkus + Jdbi
  • Micronaut Data JDBC
  • Jex + Jdbi

Each application runs alongside PostgreSQL 18.7 on a 512 MiB Debian 13 VM with 1 vCPU, no swap and HotSpot 27 (-Xms16m -Xmx80m -XX:+UseG1GC).

Key results:

  • All eight runs sustained 40 requests/sec without errors or timeouts.
  • Sustained p99 latency ranged from 11.02 to 11.51 ms.
  • Sampled peak application RSS ranged from 148 to 233 MiB.
  • Application readiness ranged from 4.64 to 10.82 seconds.

The benchmark uses shared correctness checks, a versioned protocol, recorded measurements and automated report generation.

Spring Boot + JDBC is the reference implementation, and the other implementations reproduce its application behavior. The benchmark compares complete SQL-first application stacks rather than isolated framework overhead. The goal is to understand practical trade-offs under realistic resource constraints.

I'm also the author of CoilBase, which the Jex and Quarkus implementations use as a thin integration layer around Jdbi. Given its simple implementation, I expect its overhead to be negligible. It hasn't been measured separately, but I'd be happy to run an isolated comparison if there's interest.

Article: https://pvrlabs.xyz/java-performance/experiments/benchmarking-java-frameworks-512mib.html

Benchmark source: https://github.com/PVRLabs/framework-benchmarks

I'm currently considering two directions for the next comparison:

  • Add Helidon to broaden the Java framework comparison.
  • Add a Go implementation as a first cross-language comparison, opening the door to community contributions in other languages, such as Rust.

Which direction would you find more interesting? Other suggestions are welcome too.