Skip to main content

Benchmarks

Two comparisons. The framework comparison is reproducible from the perf/ directory of the framework repository (python3 perf/run.py); the DI comparison from ligero-examples. Absolute numbers depend on your hardware — the point is the shape of the differences, and that you can re-run them yourself.

See it race​

Process exec to first HTTP 200, shown 3× slower. Drag to rotate.

  • Ligero (Pluma): 369 ms
  • Javalin 6 (Jetty): 637 ms
  • Ligero (Jetty): 593 ms
  • Ligero (JDK): 478 ms
  • Ligero (JDK, typed): 493 ms
  • Spring Boot 4.2 (VT): 1901 ms
  • Spring Boot 4.2: 1842 ms
  • Spring Boot 3.5: 1892 ms

Framework comparison (same app, eight setups)​

The same products CRUD app (GET /products, GET /products/{id}, POST /products, in-memory store) built in each framework and launched identically (installDist → start script, same JVM flags). From a run on a 4-core machine, JDK 21 — medians of 3 interleaved rounds, 32 keep-alive connections, requests per second:

FrameworkGET listGET by idPOSTOverallp99 list (ms)Startup (ms)Dist libs (MB)
Ligero (Pluma engine)173 758184 657131 595161 6282.603692.8
Javalin 6 (Jetty)58 38758 48148 43754 8914.586378.3
Ligero (Jetty engine)44 85643 59835 75041 1963.435935.4
Ligero (JDK engine)39 40138 80631 87036 5253.164782.7
Ligero (JDK engine), typed controllers36 91538 81932 82336 0973.314932.7
Spring Boot 4.2 (MVC / Tomcat), virtual threads36 41933 68826 04831 7343.621 90119.9
Spring Boot 4.2 (MVC / Tomcat)35 57032 15824 83330 5124.321 84219.9
Spring Boot 3.5 (MVC / Tomcat)28 19829 50826 34827 9885.181 89220.9

Spring Boot 4.2.0 runs on Spring Framework 7.1, Tomcat 11 and Jackson 3; Spring Boot 3.5.16 is the last 3.x line, for comparison.

Overall = geometric mean of the three scenarios. Startup = process exec → first HTTP 200.

What it says:

  • Ligero's own engine leads by a wide margin — about 2.9× Javalin and 5.3× Spring Boot 4.2 — while starting fastest and shipping the smallest dependency tree. ligero-server-pluma implements HTTP/1.1 itself, with one thread per connection and no dispatcher in between.
  • The engine is what matters. The same Ligero application on the JDK's built-in server is 4.4× slower: that server tops out at roughly 48 000 requests/s on this machine with no framework on top at all.
  • Spring Boot 4 is faster than 3.5, not fast. 4.2 gains about 9 % over 3.5 overall (and 3 % more with virtual threads), still below Ligero on the JDK's own server, and it takes five times as long as the Pluma engine to start. See Ligero and Spring Boot 4 for the feature side of the comparison.
  • Typed controllers cost nothing. They run at the same throughput as hand-written lambdas, because the routing code is generated at compile time.
  • The lead depends on the machine. On the GitHub-hosted runner that checks every pull request the same benchmark measured the Pluma engine at 1.4× Javalin and 2.6× Spring Boot 3.4 — still first, by a smaller margin than on the development machine above.
  • And on the workload. The Pluma engine serves its first 256 concurrent connections on dedicated threads. With 1 000 busy connections it measured 57–110 thousand requests/s against Javalin's 73 thousand.

HTTP/2 and TLS. Measured with h2load against the Pluma engine on the same machine (GET /products, requests/s):

PlainTLS 1.3
HTTP/1.1, 32 connections140 43795 445
HTTP/2, 8 connections × 16 streams141 564120 482

Multiplexed HTTP/2 matches HTTP/1.1, and TLS costs roughly 15–30 %.

Earlier numbers

Previous versions of this page showed about 13 000 requests/s for every fast framework. That figure was the load generator's limit, not the servers': the driver has since been replaced by a raw-socket client that is cheap enough to let the servers be the bottleneck.

Checked on every pull request. The framework repository runs this benchmark for each PR against its target branch and fails the check if any scenario gets more than 10 % slower, or if Ligero's lead over the other frameworks drops below a recorded floor.

Verdict — which should you pick?​

If you want…PickWhy
Best all-roundLigero (Pluma engine)highest throughput, fastest startup, smallest deps, WebSockets, plus DI/modules/devtools
Nothing but the JDK's own serverLigero (JDK engine)the conservative default; still ahead of Spring Boot
A long-established third-party serverLigero (Jetty engine)same app, one dependency swap via the ServerEngine SPI
The biggest ecosystem & maturitySpring Bootnot what this benchmark measures — slowest to start and heaviest, but the ecosystem (messaging, gRPC, GraphQL, batch...) is unmatched; see what Spring Boot 4 has that Ligero does not

Dependency-injection comparison​

Wiring cost of a 100-bean dependency graph (fresh JVMs, median of 5), comparing Ligero's Beans container to reflection/scanning containers:

ContainerMedian wiring timeRelative
Ligero Beans~65 ms (≈ class-loading; the container works in µs)1×
Guice 7~400 ms~6×
Spring 6.2 (component scanning)~555 ms~8.5×

Explicit lambda bindings do no classpath scanning and no reflective injection, so "wiring" is essentially just running your constructors — which is why it barely registers next to class-loading.

Reproduce​

# framework comparison — from the framework repository
./gradlew publishToMavenLocal -Pversion=0.0.0-pr-SNAPSHOT -x javadoc
python3 perf/run.py --candidate 0.0.0-pr-SNAPSHOT
python3 perf/run.py --candidate 0.0.0-pr-SNAPSHOT --spring-extras # + Spring Boot 4.2 on virtual threads and 3.5
python3 perf/run.py --help # rounds, duration, connections, gates

perf/run.py builds each app, starts it cold several times in interleaved rounds, drives it with perf/Load.java — a zero-dependency raw-socket HTTP client on virtual threads — and compares the medians. Everything runs on one machine, load driver included, so compare rows of the same run rather than numbers across machines.