Add aot-cache module: the JDK 25 AOT cache on Spring Boot 4.1 vs AppCDS, Spring AOT and GraalVM native
A Spring Boot 4.1.1 order service started 12 ways (plain and extracted jar, Spring AOT output, AppCDS, AOT cache trained with and without traffic, JDK 27, native image), ten interleaved rounds each, with first-request latency; 24 cache-mismatch cases; Docker layer arithmetic. Transcripts are in output/ (no docs/ folder). Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TF9JWFvJSNm6HVzswzZU5a
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
# NOT BUILT OR RUN while writing the article: the sandbox has no Docker daemon. The commands inside it are the ones
|
||||
# scripts/train.sh and scripts/mismatch.sh ran (extract, AOTCacheOutput, AOTCache); the layer arithmetic is in
|
||||
# output/05-layers.txt. Treat the file as a starting point and measure it in your own registry.
|
||||
#
|
||||
# Build: mvn -DskipTests package && docker build -f docker/Dockerfile -t aot-cache .
|
||||
|
||||
FROM eclipse-temurin:25-jdk AS extract
|
||||
WORKDIR /build
|
||||
COPY target/app.jar app.jar
|
||||
RUN java -Djarmode=tools -jar app.jar extract --layers --destination extracted
|
||||
|
||||
# The final image is also where the cache is trained: the cache records the exact JVM build and the exact
|
||||
# jar files (size and modification time), so it must be created by the JVM that will use it, after the last COPY.
|
||||
FROM eclipse-temurin:25-jre
|
||||
WORKDIR /application
|
||||
COPY --from=extract /build/extracted/dependencies/ ./
|
||||
COPY --from=extract /build/extracted/spring-boot-loader/ ./
|
||||
COPY --from=extract /build/extracted/snapshot-dependencies/ ./
|
||||
COPY --from=extract /build/extracted/application/ ./
|
||||
RUN java -XX:AOTCacheOutput=app.aot -Dspring.context.exit=onRefresh -jar app.jar
|
||||
ENTRYPOINT ["java", "-XX:AOTCache=app.aot", "-jar", "app.jar"]
|
||||
Reference in New Issue
Block a user