[prev in list] [next in list] [prev in thread] [next in thread]
List: groovy-user
Subject: Re: [groovy-user] performance issue with many scripts
From: Ralph Johnson <johnson () cs ! uiuc ! edu>
Date: 2011-08-22 12:59:35
Message-ID: CAB_aMcucibQi34Fuh_nb9U7i7D66QavN-WMEGnFxT4n+xbq4ng () mail ! gmail ! com
[Download RAW message or body]
Thanks for your response!
We are using GroovyShell, and I solved the immediate crisis by using a
single instance of GroovyShell to compile all the scripts instead of
making a new instance for each one. These scripts *are* a lot like
closures, and there might be a much better way to implement them. In
fact, after reading about Groovy metaprogramming in more detail, I am
thinking that we ought to produce entire classes instead of just one
script at a time. Usually we bundle a set of scripts together, and we
could just as easily produce a new class to represent the entire set.
Our scripts have names like Script124. I didn't know you could name
them. It would certainly help debugging for them to have better
names. I'll look into that.
The book talked about GroovyShell, GroovyScriptEngine, and
GroovyClassLoader. I was thinking that maybe we should be using
GroovyClassLoader instead, but I will look at CompilationUnit as well.
I have been putting off reading the source for Groovy, but I guess it
is about time to start.
-Ralph Johnson
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic