Configuring a project with lots of groovy sources

I have a webapplication project using Spring MVC. I use Groovy for controllers - that's cool, full hotswapping, easy to write, easy to handle xml, fast enough. But there's one major problem. Each application startup lasts long. I have ~300Kb groovy code. The optimistic result for startup is 70-80 seconds. That can be 3 mins, or more if the system is busy. Profiling showed that most of time it spends compiling groovy scripts on startup. And the groovy compiler performance is pretty low.
Maybe I can somehow reconfigure the project to keep groovy compiler from compiling all these 300K every application start?
I have all my scripts in WEB-INF/groovy directory, thus they're not treated as java sources. I instanciate groovy beans using

and constructor-arg for script name.

Comment actions Permalink

As ever, Grails- and Groovy-related questions are best posted in the JetGroovy forum:

Randall Schulz

Comment actions Permalink

I'm afraid, JetGroovy has nothing to do with the problem. It doesn't compile or copy compiled groovy sources in any way.
Groovy sources are compiled on application startup, and Spring is the compiler invoker, as it instanciates scripted beans.
Anyway, I'll repost the question in JetGroovy forum. Sorry for inconvenience.


Please sign in to leave a comment.