Spring startup performance issues

前端 未结 6 716
春和景丽
春和景丽 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:30

    Not much you can do about the performance there, I guess you aren't concerned about the startup in production environment, but the startup time of your tests*. Two tips:

    • Review that your test-appcontext only uses the minimally required components of your app
    • instead of having a list of component-scan directives, use one, with a comma-separated value like this: base-package="com.package.one,com.package.two..."

提交回复
热议问题