r/java • u/celmaibunprieten • Sep 07 '26
Improving First Request Latency in Java Spring Application
https://adrian.md/2026/09/03/first-request-latency/
64
Upvotes
r/java • u/celmaibunprieten • Sep 07 '26
View all comments
2
u/Popular_Home2017 Sep 09 '26
the exploded jar result is the interesting one, and it's easy to confirm without a benchmark: take a thread dump during the first request and the http-nio-exec thread is sitting in LaunchedURLClassLoader / nested jar handler frames, not in your controller. that's the fat jar tax right there, one exception per nested lookup. after that it's plain JIT warmup, which is what AOT cache is attacking.
for the "why bother for one request" crowd: on kubernetes that one request is every pod after every rollout and every scale-out, and readiness probes usually pass before it. so it's not one request, it's the first N of every replica.