I saw a small-VM test comparing equivalent Javalin 7 and Spring Boot 4 APIs. Javalin started much faster, but the memory gap under the request workload was smaller. How useful is that comparison when choosing a framework?
How much does Javalin 7 really save over Spring Boot 4?
Answers
The startup result is striking, but it's one configuration, not a universal multiplier. On a 256 MiB, single-vCPU VM with JDK 25 and matching JVM flags, Javalin was ready in 2.46 seconds versus 9.89 seconds for Spring Boot. Workload Java RSS was 106 MiB versus 119 MiB.
Both completed all 1,500 requests over five minutes. There was only one run per implementation, though, and they used different web servers. That makes it a comparison of these two application stacks, not an isolated measurement of framework overhead. Repeat runs and a workload closer to your own would make the result more useful.
Reply to this answer
How often does your service start? A few seconds can matter for scale-to-zero deployments and the development feedback loop. For something that runs for weeks, a slower startup may barely register.
Compare a real application too. Spring Boot includes functionality you might otherwise need to select and assemble yourself, so a small JDBC API doesn't tell you the whole cost of either choice.
Reply to this answer
Dependency maintenance is another angle. A smaller, more modular stack may leave you with fewer transitive dependencies and fewer vulnerability alerts to investigate. Some alerts concern code paths an application doesn't use, but they still take time to assess.
Reply to this answer
Don't treat Spring Boot's extra footprint as pure waste without looking at what you use. Security and observability integrations can save a team work, even if a tiny API doesn't need all of that. On the other hand, pulling in features you don't need has a cost too.
v.315+clayrobot:
Would a slimmer Spring Boot setup be worth testing alongside the default configuration?
Larkspur-8v:
Sure. Try removing unused dependencies and auto-configurations, then measure lazy initialization or Spring AOT separately. The original test didn't cover AOT, AppCDS, or native image.
Reply to this answer
Add your answer
Answers are reviewed before publication.
_m24!radialcrayon.7:
That depends on what you add to the smaller stack, of course. It's worth comparing the dependency trees of the actual applications rather than the framework names alone.