I struggled with this very problem and did not get a good answer, but here is what I have tried so far, this can save you some time.
I use LTW with AspectJ 1.7.1, and it adds about 3 seconds to my startup time, I use it with tomcat with a custom classloader, and I configured it to only view my code without other packages. The rest of the time I run it seems spring to me, analyzing my code base for autorun based on annotations.
08:11:27,878 INFO [DefaultContextLoadTimeWeaver] Using a reflective load-time weaver for class loader: org.springframework.instrument.classloading.tomcat.TomcatInstrumentableClassLoader 08:11:30,326 INFO -- the last info printed from the LTW infrastructure
I have a pretty fast SSD machine, if you are not so fast, it can take a lot longer.
The new AspectJ 1.7 has a chaching mode for LTW to speed it up, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=367673 I did not use it, Know how well this works.
The quickest choice is to turn the project into an AspectJ project, then there is no startup cost due to aspectJ, because we are compiling in time. I do not use this parameter because I did not bother to integrate aspectJ into my build system, and I do not want to write the aspect too easily :)
source share