Spring 引导启动程序包会影响性能吗?
Do Spring Boot starter packages impact performance?
可以 gradle 启动包 spring 引导,例如
org.springframework.boot:spring-boot-starter-web
org.springframework.boot:spring-boot-starter-cache
引入任何明显的延迟(>2ms api 响应时间)而不是非启动器,特定包?通过依赖减速来显式和具体化会显着提高性能吗?
另一个相关问题,假设一个启动包包含一个 package/dependency 我没有 use/implement 在服务中(直接或间接),该包是否被加载或对性能有任何影响服务?
introduce any significant latency (>2ms api response time) as opposed to non-starter, specific packages?
通常,拉入包会在运行时引入任意内容,并任意更改响应时间。对于入门包和非入门包来说都是如此。入门包通常设计为 "wire things in" 您的应用程序上下文,因此它们更有可能。话虽这么说,spring 引导设计为生产就绪,因此发布了 spring 提供的启动包(与 SNAPSHOT 构建或来自某些随机 github 回购的东西相反)在我的经验丰富,靠谱。
Would it have any significant improvement of performance to be explicit and specific with dependency deceleration?
也许吧,但我认为这不太可能。我强烈认为,通过开发复杂性来解决性能问题并不是最有效的方法,购买 more/bigger 硬件要便宜得多。有很多分析可以支持这一点 (google "premature optimization")。
Another relevant question, suppose a starter package included a package/dependency I did not use/implement in the service (directly or indirectly), does that package get loaded or have any impact on the performance of the service?
Class 在 java 中加载是一个有点复杂的话题。这是一篇不错的文章。 https://zeroturnaround.com/rebellabs/rebel-labs-tutorial-do-you-really-get-classloaders/2/
可以 gradle 启动包 spring 引导,例如
org.springframework.boot:spring-boot-starter-web
org.springframework.boot:spring-boot-starter-cache
引入任何明显的延迟(>2ms api 响应时间)而不是非启动器,特定包?通过依赖减速来显式和具体化会显着提高性能吗?
另一个相关问题,假设一个启动包包含一个 package/dependency 我没有 use/implement 在服务中(直接或间接),该包是否被加载或对性能有任何影响服务?
introduce any significant latency (>2ms api response time) as opposed to non-starter, specific packages?
通常,拉入包会在运行时引入任意内容,并任意更改响应时间。对于入门包和非入门包来说都是如此。入门包通常设计为 "wire things in" 您的应用程序上下文,因此它们更有可能。话虽这么说,spring 引导设计为生产就绪,因此发布了 spring 提供的启动包(与 SNAPSHOT 构建或来自某些随机 github 回购的东西相反)在我的经验丰富,靠谱。
Would it have any significant improvement of performance to be explicit and specific with dependency deceleration?
也许吧,但我认为这不太可能。我强烈认为,通过开发复杂性来解决性能问题并不是最有效的方法,购买 more/bigger 硬件要便宜得多。有很多分析可以支持这一点 (google "premature optimization")。
Another relevant question, suppose a starter package included a package/dependency I did not use/implement in the service (directly or indirectly), does that package get loaded or have any impact on the performance of the service?
Class 在 java 中加载是一个有点复杂的话题。这是一篇不错的文章。 https://zeroturnaround.com/rebellabs/rebel-labs-tutorial-do-you-really-get-classloaders/2/