1/1/2023 0 Comments Reduce startup timeI did 4 tests (you can find the startup logs in the boot.log file of each branch): So, I was able to make a test project with some Netfllix dependencies. The first test I made threw me off track. So, as pointed out, my understanding of the auto-configuration process was not very good. Sorry for the late feedback, I don't have much time to work on it. This would not make Spring start as fast as possible, but would definitely improve it big time. Note: I'm really only talking about saving where the files are, not the actual result of executing them, because that would change depending on the given runtime configurations. #Reduce startup time fullwhile launching a container from the previously built image, read the saved file and execute any found auto-configuration class, rather than doing a full class-path scan again.while building the docker image, look for all the auto-configuration classes. My typical use case is using Spring Boot with Docker. I would very like having a way for Spring to remember where the auto-configuration classes are, and only read them at boot time. Using the explicit import is hard to maintain, mostly because you need to verify it at each Spring Boot Upgrade. Putting aside the fact that I can certainly reduce the number of jars I have in my class-path, the startup difference is very big. This is mainly due to scanning the whole class-path Vs providing the exact classes to read. When using Spring Cloud + some other dependencies, there so many auto-configuration classes to find that the startup is very slow (about 20sec).ĭisabling the auto-configuration, and using explicit instead reduces the startup time by almost 2 (about 11 seconds). this is great, except for the startup time. I'm currently developing microservices using Spring Boot.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |