一、yml中设置懒加载
spring:
main:
lazy-initialization: true
二、SpringBoot启动类中添加注解 @Indexed (Spring5才有该注解)
@Indexed
@EnableAsync
@RestController
@SpringBootApplication(exclude = {WxMaAutoConfiguration.class})
@EnableTransactionManagement
@MapperScan(basePackages = {"co.xuexi.modules.*.service.mapper", "co.xuexi.config"})
public class AdminRun {
以上两种对SpringBoot启动速度的优化都不高,只能提高20%左右
三、升级jdk到17
四、使用SpringBoot3