In our application we are experiencing performance problems with component-scan. It is quite slow and its performance does not depend on number of classes in the scanned package.
Each line like this in our sping configuration file:
<context:component-scan base-package="foo.bar" />
adds 2 minutes to startup time of our application. Number of classes in the scanned package does not matter - we are experiencing the same delay both for packages with 10 and 1k classes.
Why performance of component-scan does not depend on the size of the scanned package?
We are using mixed approach for creating spring beans - we use both xml definitions and component scan. Can this be the reason for such a behavior?