8
votes

We've using groovy/grails for a couple of months and find it very nice language and framework, at least for prototyping.

The only thing constantly driving us mad is projects build time. Compiling small app consisting of few tiny domain classes took up as much time as if we are compiling something well, something more serious ))) So, the question is - are there any techniques and approaches which can be used to reduce grails project build time?

UPD: this question covers one of aspects, which make grail deployment slow - dependency resolution. In short, get rid of snapshot dependencies. The subquestion is how can I detect such dependencies fast?

1
If you mean development time, one way [and probably the advised approach by Grails team] would be to move your logic to services. This way changing something in your code does not involve rebuild & reload of the application. It does save me a lot of time during development stages. - Krystian
@Krystian, don't understand why compiling full fledged webapp with old and almost obsolete ant is times faster than compiling grails application. What kind of logic I should move to services? I have only bunch of controllers returning JSON output. - shabunc

1 Answers

8
votes

In development, you can try running the script runner in interactive mode:

grails interactive

or, in Grails 2, simply

grails

It keeps JVM running between grails commands invocations, which greatly reduces their overhead. I found this of a great use when doing TDD, as running tests becomes much quickier that way.