You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By default, the Spring Boot Gradle plugin performs an "optimized launch" when executing the bootRun task which appears to be adding "-XX:TieredStopAtLevel=1" as an optimization.
A student of mine wrote a Spring Boot application that first reads a 250MB GTFS file (i.e. a ZIP containing text files in CSV format) and then performs a large number of hash table lookups as part of its initialization. Due to this optimization, the CSV parsing is slower by a factor of approx. 4 and the performance of the hash table lookups decrease by a factor of approx. 200. I have tested this with JDK 17 on Windows and MacOS.
Of course, it is possible to configure bootRun with an "unoptimized launch" by setting optimizedLaunch to false, but I think that this optimization should probably be removed, at least for JDK 17 Termurin. As an alternative it might make sense to change the default for "optimizedLaunch" to false, since it takes to time to find issues like this when you are not actively enabling something that does not always work as expected.
Cheers,
Marcus
The text was updated successfully, but these errors were encountered:
By default, bootRun will configure the JVM to optimize its launch for faster startup during development.
This comes at the cost of potentially reduced peak performance. I think that's what you're seeing here and I don't think it's specific to any particular JVM.
As the documentation states, the goal is to speed things up during application development when starting the app occurs frequently. Where peak performance is required, the application should be started in a way that's intended for a "production" environment. That's often java -jar or java -cp with an exploded jar referencing Spring Boot's launcher or the application's main class directly.
I don't think we should change anything here. From what we've seen, your situation is atypical and I think the current defaults are working as documented and strike the right balance. Thanks anyway for raising your concerns.
Hello everyone,
By default, the Spring Boot Gradle plugin performs an "optimized launch" when executing the bootRun task which appears to be adding "-XX:TieredStopAtLevel=1" as an optimization.
A student of mine wrote a Spring Boot application that first reads a 250MB GTFS file (i.e. a ZIP containing text files in CSV format) and then performs a large number of hash table lookups as part of its initialization. Due to this optimization, the CSV parsing is slower by a factor of approx. 4 and the performance of the hash table lookups decrease by a factor of approx. 200. I have tested this with JDK 17 on Windows and MacOS.
Of course, it is possible to configure bootRun with an "unoptimized launch" by setting optimizedLaunch to false, but I think that this optimization should probably be removed, at least for JDK 17 Termurin. As an alternative it might make sense to change the default for "optimizedLaunch" to false, since it takes to time to find issues like this when you are not actively enabling something that does not always work as expected.
Cheers,
Marcus
The text was updated successfully, but these errors were encountered: