I have an application that is getting fairly large, and the Spring start up time is about 20 seconds. For production use, this is fine, but for development, this is a big pain.
What is a good profiling tool or approach that can give me precisely the information I need to figure out what is taking so long? Maybe it's something I can optimize?
My application is a fairly typical spring/hibernate web app. There's about 50 database tables and several hundred beans (like 200-300... I didn't count). There's a few @Configurable beans. Lots of component scanning. I am also using Spring Security.
I did some primitize profiling with log4j - just at the INFO setting. Here are some of the things that are taking a bit of time:
- INFO DefaultListableBeanFactory:555 - Pre-instantiating singletons - 2 seconds
- INFO SessionFactoryImpl:202 - building session factory - 2 seconds
- INFO HibernateTransactionManager:415 - Using DataSource [com.mchange.v2.c3p0.ComboPooledDataSource......] of Hibernate SessionFactory for HibernateTransactionManager - 7 seconds
There are a couple of things that take .5 to maybe 1 second at the most, but these 3 were the largest ones.