views:

49

answers:

1

I've switched from classpath scanning of Controller classes to explicitly declaring the beans, but was wondering what else I can do to cut down on the initial startup of a Spring MVC application.

+1  A: 

Not knowing the specifics of your project, I would say your best bet is to profile the startup of your Spring MVC application.

  • You can do this using %JAVA_HOME%\bin\jvisualvm.exe from the Sun JDK, if that's what you're using.
  • Netbeans has a good article on profiling Java web application.
  • If you are working on an open-source project or have the money, you can use YourKit.

Have you ever profiled before? You should start profiling when your specific webapp starts loading and stop when it's done, if you know it's your web app that is causing the slowdown.

Otherwise, you should profile your entire web container / app server from start to running.

The Alchemist