Files
Ankur Mhatre 958b401f0f Spring Boot startup time: bean-by-bean diagnosis, and one directory per post
Adds spring-boot-startup-time/, the companion project for BLOG-618: a runnable
Spring Boot 4.1.1 application on JDK 25 that installs BufferingApplicationStartup
and FlightRecorderApplicationStartup behind a system property, and a /diag/startup
endpoint that computes step self time -- the number /actuator/startup does not give
you and the one that names the actual culprits.

Captured under docs/output/: the step tree sorted both ways, the same startup as JFR
events, a +5000-class experiment putting 0.11 ms per scanned class on the classpath
scan tax, the silent truncation a 2048-step buffer performs, and JDK 25 AOT cache
timings (6.93 s to 4.82 s). Post body and metadata live in post/.

Moves the existing Actuator project into actuator-in-production/ so the repository
holds one directory per article; the root README is now an index.
2026-09-05 00:17:37 +05:30

33 lines
1.9 KiB
Plaintext

variant | Started in (s), each run | median
-----------------------------------+----------------------------+---------
no tracking | 6.871,6.456,7.473,6.992 | 6.9315
BufferingApplicationStartup | 6.448,6.856,6.416,6.528 | 6.488
FlightRecorder + recording | 6.496,6.739,6.343,6.475 | 6.4855
lazy-initialization | 5.075,5.331,5.217,5.266 | 5.2415
=== JDK 25 AOT cache (Project Leyden) ===
openjdk version "25.0.4.1" 2026-08-18 LTS
-- training run (-XX:AOTMode=record) --
-rw-r--r-- 1 eloquent-blissful-maxwell eloquent-blissful-maxwell 119484416 Sep 4 23:44 /tmp/app.aotconf
-- assembly run (-XX:AOTMode=create) --
Reading AOTConfiguration /tmp/app.aotconf and writing AOTCache /tmp/app.aot
AOTCache creation is complete: /tmp/app.aot 118001664 bytes
-rw-r--r-- 1 eloquent-blissful-maxwell eloquent-blissful-maxwell 118001664 Sep 4 23:44 /tmp/app.aot
AOT cache (-XX:AOTCache) | 5.028,4.729,4.708,4.905 | 4.817
AOT cache + lazy | 3.649,3.488,3.354,3.384 | 3.436
=== where the AOT cache takes the time from (same tracker, same jar) ===
run | parse ms | inst ms | webserver
-----------------------+-----------+-----------+----------
plain | 986.66 | 4344.21 | 150.69
aotcache | 729.16 | 3155.96 | 100.96
Notes:
* Timings are from one machine (Temurin 25.0.4.1+1, Linux x86_64, container) and are
indicative. The ratios between rows are the point, not the absolute numbers.
* "no tracking" and the two instrumented rows overlap. Recording startup steps is not
measurably slower than not recording them on this application.
* The AOT cache was trained on this exact jar with -XX:AOTMode=record and assembled with
-XX:AOTMode=create. It is 118 MB and is invalidated by a classpath change.