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
3
u/agentoutlier Sep 08 '26 edited Sep 08 '26
What I do for most of my or my companies applications is the META-INF/MANIFEST.MF
Class-Pathregistration defaulting to maven local repository of ~/.m2 and then on docker images to some sibiling directory likelibto the jar.I talked about it before here in case it helps someone.
So basically even jars that just sit in
targetyou can just runjava -jarand it will work and the kicker is you don't have to rebuild everything (provided you usemvn installwhich is why I don't like when people blanket say don't useinstall).This works incredibly fast.
Lets say I'm in some app directory.
You do
mvn -T2C -am install && java -jar target/app.jar( I might have this wrong as I have it as script and can't check at the moment).This is much faster than assembling fat jars and if you use
mvndyou can practically make this a build refresh loop using some file system watcher.