O'Reilly logo

Hands-On High Performance with Spring 5 by Dinesh Radadiya, Prashant Goswami, Pritesh Shah, Subhash Shah, Chintan Mehta

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Overhead with the @SpringBootApplication annotation

The @SpringBootApplication annotation is a provision for the developers who used to annotate Spring classes with @ComponentScan, @EnableAutoConfiguration, and @Configuration. So, the @SpringBootApplication annotation is equivalent to using three annotations with default configurations. The implicit @ComponentScan annotation scans the Java classes defined in the base package (package for the Spring Boot application main class) and all subpackages. This slows down the application startup when the application has grown significantly in size.

To overcome this, we can replace the @SpringBootApplication annotation with individual annotations where we provide package paths to be scanned with

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required