04

Demo 04 — Project Leyden AOT Cache

Quarkus 3.33.1 / JDK 25 LTS ⏱ ~12 min JDK 25
cd quarkus-demo-04-leyden
chmod +x demo.sh
./demo.sh

Verified result: 609ms → 148ms (−75%) startup on JDK 25 LTS. Caches parsed + linked classes AND JIT method profiles. First requests after startup get near-peak JIT performance.

Configuration

# application.properties
quarkus.package.jar.aot.enabled=true
# Quarkus automatically switches to aot-jar packaging
mvn verify   # runs @QuarkusIntegrationTest → writes app.aot

Three-stage Dockerfile

Stage Image Purpose
compiler maven:3.9-eclipse-temurin-25 Build JAR
trainer ubi9/openjdk-25 Run integration tests → create app.aot
runtime ubi9/openjdk-25-runtime Copy JAR + app.aot

JVM fingerprint must match between trainer and runtime.

Common pitfalls

  • @QuarkusIntegrationTest not @QuarkusTest — only integration tests train the cache
  • mvn verify not mvn package — failsafe plugin only fires in verify phase
  • Don’t add -XX:AOTCache to Dockerfile — Quarkus sets it automatically

Reference