Performance Comparison of AOT‑Processed Java (Native Image) with Binary, JAR, Go, and Rust Deployments
This article evaluates the startup speed, memory consumption, and request‑handling throughput of a Spring Boot application built as a GraalVM native binary, a regular JAR, and equivalent services written in Go and Rust, highlighting the trade‑offs of AOT compilation for backend development.
The author demonstrates a Spring Boot service exposing @GetMapping("/customers") that returns a static list of three customers, built both as a GraalVM native binary and as a traditional JAR. The binary is launched instantly, uses ~70 MB memory under load (≈20 MB idle), and achieves 7 076 requests per second in an ab test (1.4 s for 10 000 requests).
In contrast, the JAR package occupies only 19 MB on disk but consumes about 200 MB memory under load (≈160 MB idle) and requires JVM warm‑up; its ab benchmark shows 558 requests per second (17.9 s for 10 000 requests).
For a Go implementation using only the standard library, the service runs with roughly 10 MB idle memory (≤20 MB with a framework) and reaches 7 247 requests per second (1.38 s for 10 000 requests) in the same test.
The Rust version, built with Actix‑web, uses about 3 MB idle memory and 6 MB under load, delivering 9 163 requests per second (1.09 s for 10 000 requests). However, the Rust compilation time is notably long (≈213 s on the author’s machine).
Overall, AOT‑processed native images provide dramatic startup‑time reduction and lower runtime memory compared with traditional JVM deployments, eliminating the need for JVM warm‑up, though they suffer from very slow build times (≈15 minutes for the demo). The results suggest that Java, when compiled to native images, has become competitive in cloud‑native environments.
Architecture Digest
Focusing on Java backend development, covering application architecture from top-tier internet companies (high availability, high performance, high stability), big data, machine learning, Java architecture, and other popular fields.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.