Grokking Spring Boot
Vote

0% completed

​

Lazy and Eager Initialization

We started the booking service twice on one laptop, changing a single setting between the runs, and timed the startup and the first request for a seat map.

RunStartupFirst GET /events/7/seats
Default4.502 s0.182 s
Lazy initialization on3.071 s1.762 s

The setting moved about one and a half seconds of work out of startup and into the first request. Both runs still did the slow work. The main difference is when one slow bean was created, and who waited for it.

.....

.....

.....

Like the course? Get enrolled and start learning!

Reading Progress

0%


Vote for new content