8

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?

Community
  • 1
  • 1
shabunc
  • 23,119
  • 19
  • 77
  • 102
  • 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 Nov 24 '11 at 16:06
  • @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 Nov 29 '11 at 10:13

1 Answers1

8

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.

socha23
  • 10,171
  • 2
  • 28
  • 25
  • nice answer, upvoted. Nevertheless still painstakingly slow. Dependency resolving yet take seconds. – shabunc Nov 29 '11 at 10:10
  • @shabunc with interactive mode, dependencies will only need resolving once per session rather than once per restart. To recompile/restart the grails server, run `exit` and then press again to restart the app. – Armand Nov 30 '11 at 14:54
  • Unfortunatly, this is officially deprecated. Grails is really shitty. – Sliq Jun 02 '13 at 16:14
  • It's deprecated only because currently running `grails` without any parameters now does the same thing. – socha23 Jun 03 '13 at 17:53