优化SpringBoot启动速度

SpringBoot程序优化

  1. 延迟初始化Bean
spring:
  main:
    lazy-initialization: true
  1. 创建扫描索引

  	org.springframework
  	spring-context-indexer
  	true


//在启动类中添加注解@Indexed
@Indexed
@SpringBootApplication
public class Application {
    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }
}

你可能感兴趣的:(spring,boot,spring,java)