# Post metadata ## Title Why Your Spring Boot App Takes 8 Seconds to Start: A Bean-by-Bean Diagnosis ## Slug `spring-boot-startup-time-bean-by-bean-diagnosis` ## Excerpt Spring Boot logs one startup number and hides four phases behind it. This walks through turning on the `ApplicationStartup` instrumentation that ships switched off, reading the step tree by self time rather than total duration — the mistake that makes people optimise a bean costing 10 ms instead of the one costing 504 — and then puts measured numbers on component scanning (0.11 ms per class inspected, whether or not it is a bean), on the silent truncation a 2048-step buffer performs on your recording, and on the JDK 25 AOT cache, which took 6.93 s to 4.82 s on the companion project without a line of application code changing. ## Categories | Category | Term ID | |---|---| | Java | 328 | | Spring | 355 | ## Yoast | Field | Value | |---|---| | `_yoast_wpseo_title` | Spring Boot Startup Time: A Bean-by-Bean Diagnosis | | `_yoast_wpseo_metadesc` | Turn on Spring Boot's built-in startup instrumentation, read the step tree by self time, and see measured numbers for component scanning, buffer truncation and the JDK 25 AOT cache. | | `_yoast_wpseo_focuskw` | spring boot startup time | ## Files | File | Contents | |---|---| | [`post.md`](post.md) | article body, Markdown | | [`images/01-self-time-vs-total-time.svg`](images/01-self-time-vs-total-time.svg) | the same 400 steps ranked by total duration and by self time | | [`images/02-buffer-truncation.svg`](images/02-buffer-truncation.svg) | what a 2048-step buffer keeps and what it silently drops | ## Companion project [`spring-boot-startup-time/`](..) in `asmhatre/spring-boot-demo`. ## Jira [BLOG-618](https://ankurm.atlassian.net/browse/BLOG-618) ## Verified against Spring Boot 4.1.1 (GA 20 August 2026), Spring Framework 7.0.9, Spring Data JPA 4.1.1, Hibernate ORM 7.4.5.Final, Tomcat 11.0.24, Micrometer 1.17.1, H2 2.4.240, Temurin 25.0.4.1+1 LTS, Maven 3.9.11 — see [`docs/output/00-versions.txt`](../docs/output/00-versions.txt).