Spring startup performance issues

前端 未结 6 718
春和景丽
春和景丽 2020-12-07 15:34

I\'m trying to integrate Spring in a pretty large application with thousands of classes, and i\'m experiencing huge delays starting my container because of component-scannin

6条回答
  •  南笙
    南笙 (楼主)
    2020-12-07 16:17

    I know it is an old question, and as you will see the situation was different at that time, but hopefully it can help others researching this issue as I did.

    According to this answer to a different question, The @ComponentScan annotation now supports a lazyInit flag, which should help in reducing start-up time.

    https://stackoverflow.com/a/29832836/4266381

    Note: Your edit made it sound like switching to XML by itself was the magic. Yet, looking closer at the code, you had default-lazy-init="true". I wonder if that was the true reason.

提交回复
热议问题