I inherited a SpringBoot application that was originally run with Spring boot 1.3 (embedded Tomcat) starting up the application using the java -jar project.war
command.
Since we've upgraded to Spring boot 1.4, we've noticed that it is much slower to startup and has greater latency when searching as compared with when we run the application within our IDE (Both Eclipse and IntelliJ).
A good example is doing a search for "SMITH". When we run the app within our IDE, the search takes roughly 5-6 seconds. Using the exact same codebase, embedded server configuration, and host machine - a search on "SMITH"- when started using java -jar project.war
, takes 14 seconds.
We've profiled the application up, down and backwards and still cannot figure out why it runs that much quicker within our IDE.
To get around the issues described above, we have to do the following:
- Exploding the war to a temp directory
- cd to WEB-INF directory
- run
java -classpath "lib\:classes\:lib\*.jar" my.package.Main
Why is there such a big difference in those two command line features? Does providing a classpath to Java truly boost the performance that much?
========================================================================= EDIT: I've filed https://github.com/spring-projects/spring-boot/issues/8046 with Spring, which is basically a cut and paste from here
EDIT 2: If you've run into this issue and can share your code, please do so with Spring (Use the link above); My company has their environment locked down.