Improving First Request Latency in Java Spring Application

I was recently facing a problem with first requests into a double entry financial ledger service taking more than double of subsequent requests. This got me digging into Java’s Ahead-Of-Time Cache (AOT) and Spring. I was under the wrong impression that AOT is only about startup speedup, but looking a bit through recent AOT JEP additions found out each one will bring something to the first request. JEP 483: Ahead-of-Time Class Loading & Linking (JDK 24) JEP 515: Ahead-of-Time Method Profiling (JDK 25) JEP 516: Ahead-of-Time Object Caching with Any GC (JDK 26) So here’s the setup: ...

September 3, 20264 min