Performance difference between spring javaconfig, xml config and annotations

前端 未结 4 590
天命终不由人
天命终不由人 2021-01-12 10:50

Our Spring configuration contains about 1200 beans, and we use component-scan/@Autowired. If we exported the ApplicationContext as an Xml (and still used @Autowired), we sav

4条回答
  •  甜味超标
    2021-01-12 11:35

    The difference is likely not between annotations and XML, but instead it'll be the startup performance hit of using component-scanning, which is slow. If you add component-scanning to your XML version, you should find that it's just as slow.

提交回复
热议问题