Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

grails 2 / groovy 2 / JDK7: how to reap the benefits?

I really love Grails but I was wondering how to get the performance benefits of Groovy 2. The question is how to configure the development and production environments in order to get that "close to Java" performance boost.

So, if I setup:

* JDK 7
* Groovy 2 (indie JAR to use invokedynamic)
* Grails 2.2

are there any guidelines in order to really speed my webapp out-of-the-box?

And do I need to do any re-factoring in my Grails webapp codebase? I mean that dependency injection stuff like referencing services in controllers should be statically compiled or should I keep writing code as the docs say?

ps: I guess Groovy @CompileStatic and Grails might be a relevant question...

like image 814
tmanolatos Avatar asked Apr 04 '13 06:04

tmanolatos


1 Answers

It depends on what might be slowing your web application down :) I know "it depends" is so often the answer, but it's still true.

Anyway, I've asked around and it seems that Grails and invokedynamic won't go together just yet. The reloading agent needs updating and there may be problems with the cglib/asm libraries used by Hibernate.

Regardless, internally Grails is making more and more use of @CompileStatic (for the stuff that wasn't already written in Java), so unless your app is doing a lot of work itself, you're unlikely to see a big boost with invokedynamic.

It would be useful to have some official information on this, but it's not out there right now.

like image 56
Peter Ledbrook Avatar answered Sep 19 '22 19:09

Peter Ledbrook