Skip to content

Startup performance differences between Spring Boot versions and main class vs jar file formats [SPR-14956] #19523

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
spring-projects-issues opened this issue Nov 26, 2016 · 4 comments
Assignees
Labels
status: invalid An issue that we don't feel is valid

Comments

@spring-projects-issues
Copy link
Collaborator

Bernd Götz opened SPR-14956 and commented

While I was reproducing what Josh Long was presenting in https://www.infoq.com/presentations/spring-boot-cloud-case-study, I observed some not so nice performance differences between Spring Boot 1.3.5 and 1.4.2, and the second dimension, main class vs jar file execution. I've measured the differences for all four services, config, eureka, reservation service and reservation client. Please find the numbers below.

I'm actually seeing similar performance numbers when running our Spring Boot applications
in Websphere Liberty. It seems to be connected to how the containers are taking up the involved libraries. I would not complain too much but we have to use Liberty for our local development because we depend on a Liberty/Websphere feature for our security integration for backend services. That's why we can't fall back to main class execution.

Moreover, it will always run as a war file (and maybe sometimes in the future as a jar file) in CloudFoundry, so any slow start there is also not very nice.

Any insights on this? Is this a known issue? Any idea what the root cause could be?

Regards,
Bernd

Numbers:

config-service:

Spring Boot 1.3.5/Brixton.RELEASE:
main class:
Started ConfigServiceApplication in 3.191 seconds (JVM running for 3.564)

jar:
Started ConfigServiceApplication in 5.424 seconds (JVM running for 6.105)
Started ConfigServiceApplication in 5.89 seconds (JVM running for 6.574)

-> factor 1 to 2

Spring Boot 1.4.2/Camden.SR2:
main class:
Started ConfigServiceApplication in 4.178 seconds (JVM running for 4.715)
Started ConfigServiceApplication in 4.192 seconds (JVM running for 4.598)

jar:
Started ConfigServiceApplication in 17.426 seconds (JVM running for 19.412)
Started ConfigServiceApplication in 16.899 seconds (JVM running for 18.793)

-> factor 4

eureka-service:

Spring Boot 1.3.5/Brixton.RELEASE:
main class:
Started EurekaServiceApplication in 5.324 seconds (JVM running for 5.776)
Started EurekaServiceApplication in 5.308 seconds (JVM running for 5.737)

jar:
Started EurekaServiceApplication in 10.352 seconds (JVM running for 11.322)
Started EurekaServiceApplication in 9.605 seconds (JVM running for 10.47)

-> factor 2

Spring Boot 1.4.2/Camden.SR2:
main class:
Started EurekaServiceApplication in 6.223 seconds (JVM running for 6.695)
Started EurekaServiceApplication in 5.976 seconds (JVM running for 6.501)

jar:
Started EurekaServiceApplication in 30.074 seconds (JVM running for 32.498)
Started EurekaServiceApplication in 29.58 seconds (JVM running for 31.99)

-> factor 5 to 6

reservation-service:

Spring Boot 1.3.5/Brixton.RELEASE:
main class:
Started ReservationServiceApplication in 14.975 seconds (JVM running for 15.457)
Started ReservationServiceApplication in 13.45 seconds (JVM running for 13.989)

jar:
Started ReservationServiceApplication in 25.705 seconds (JVM running for 26.753)
Started ReservationServiceApplication in 27.056 seconds (JVM running for 28.273)

-> factor 2

Spring Boot 1.4.2/Camden.SR2:
main class:
Started ReservationServiceApplication in 16.472 seconds (JVM running for 17.012)
Started ReservationServiceApplication in 15.042 seconds (JVM running for 15.517)

jar:
Started ReservationServiceApplication in 83.614 seconds (JVM running for 86.423)
Started ReservationServiceApplication in 82.873 seconds (JVM running for 85.814)

-> factor 5 !!!

reservation-client:

Spring Boot 1.3.5/Brixton.RELEASE:
main class:
Started ReservationClientApplication in 11.776 seconds (JVM running for 12.24)
Started ReservationClientApplication in 12.212 seconds (JVM running for 12.699)

jar:
Started ReservationClientApplication in 22.645 seconds (JVM running for 23.862)
Started ReservationClientApplication in 21.705 seconds (JVM running for 22.945)

-> factor 2

Spring Boot 1.4.2/Camden.SR2:
main class:
Started ReservationClientApplication in 15.828 seconds (JVM running for 16.405)
Started ReservationClientApplication in 15.606 seconds (JVM running for 16.149)

jar:
Started ReservationClientApplication in 73.462 seconds (JVM running for 76.298)
Started ReservationClientApplication in 72.955 seconds (JVM running for 75.935)

-> factor 5 !!!


No further details from SPR-14956

@spring-projects-issues
Copy link
Collaborator Author

Stéphane Nicoll commented

This is the issue tracker of the spring framework. Spring Boot related issues are tracked in a separate tracker. I've created #7493 for this, please subscribe to it for further updates.

The first thing that comes to mind is to remove the spring cloud bits to only test the difference between two spring boot versions.

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

Quick note: We had an annotation lookup performance regression in Spring Framework 4.3.4 which might shine through to Boot 1.4.2's startup times. I have yet to backport the latest changes to the 4.3.x branch, but once there, it might be worth re-testing this case as well.

@spring-projects-issues
Copy link
Collaborator Author

Bernd Götz commented

Ok, will test with 4.3 as soon as it's available. If you want, I can also look into any RCs, just let me know.

@spring-projects-issues
Copy link
Collaborator Author

Stéphane Nicoll commented

Bernd Götz can we please move that discussion on the Spring Boot issue? Can you share there the applications that you've used. I had a look to the repo reference in that infoq presentation and it does not seem to work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: invalid An issue that we don't feel is valid
Projects
None yet
Development

No branches or pull requests

2 participants