According to an article Groovy has
Unfortunately at the same time Groovy is very slow at runtime. As a person, who did a lot to improve performance of Groovy I can probably speak about that very openly. Groovy is very slow. You can easily expect that some Groovy calculation or data transformation rewritten in Java will become 3-5 times faster. Usually this factor is 8-12 and sometimes even higher. Someone can say that Java is always at our service and nobody uses Groovy for calculations or data processing... But, hey, it is exactly my point - why should we limit ourselves for just scripting or handling of simple web pages?
What is even worse is the fact that
Groovy doesn't scale well for
multi-core computers meaning that
several threads executing code
compiled by Groovy really prevent each
other from being fast. It is not a
problem for many applications but for
many others it is simply show-stopper.
Could someone proof or refute that paragraphs?
I am particularly concerned about multi threading performance.
解决方案
There are ongoing efforts to improve the speed of Groovy, but it should be said that 9 times in 10, the performance is not an issue.
However, where it is an issue you can either write that code in Java (and integrate that Java class easily into your Groovy code), or if you want to remain completely groovy, you can look into using Groovy++ which improves the speed of Groovy by making it more statically typed (with some heavy type inference to save you having to do it all yourself as with Java)
Groovy 1.8b4 (currently in beta), also comes with the GPars framework bundled with it.
The GPars project offers developers
new intuitive and safe ways to handle
Java or Groovy tasks concurrently,
asynchronously, and distributed by
utilizing the power of the Java
platform and the flexibility of the
Groovy language.
{edit July 2012}
Groovy 2.0 has a CompileStatic annotation which you may want to look into (as now Groovy++ has not been developed for quite a few months). This question here has some numbers...