Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Performance difference between spring javaconfig, xml config and annotations

Tags:

java

spring

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 saved about 10% on context startup-time.

What can we expect if we try spring javaconfig ?

like image 353
krosenvold Avatar asked Apr 13 '11 07:04

krosenvold


1 Answers

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.

like image 55
skaffman Avatar answered Sep 22 '22 22:09

skaffman