jmeter-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Danny Lade <>
Subject AW: Groovy
Date Fri, 05 Jul 2013 14:09:29 GMT
> > For the "groovy thing":
> > I would really wish to have scripts that are cached. But currently (using 2.9) this
> functionality can't be used for Java or beanshell.
> > As I found out it is deactivated in the code to "handle some bug". We
> > would use scripts much more often , but they are currently not useful for
> massive load tests (but for setup). For example we often manipulate JSON input
> for REST requests.
> So why not convert the Groovy script to a Java test element?
Because it is a new plugin which gets to be deployed with every change to all 
computers producing the load. Scripts are easy to change and mustn't deployed 
(it's done by JMeter automatically).

> > * or bundle groovy which seems to allow caching
> Including Groovy in the JMeter download won't change the behaviour from
> downloading it separately.
> In both cases the jar is present in the classpath; how can that affect caching?
I'm not sure how could you know the code about JSR223TestElement is implementing 
the support for "script compilation caching", so here comes some short code:

        // Hack as in bsh-2.0b5.jar BshScriptEngine implements Compilable but throws new Error
        boolean supportsCompilable = scriptEngine instanceof Compilable 
                && !(scriptEngine.getClass().getName().equals("bsh.engine.BshScriptEngine"));

Because the JavaScriptEngine is based on the BshScriptEngine the "script compilation caching"

isn't available for Java, but it is available for groovy. 
And therefore a (pre)compiled script does not load any classes (but in the very first step),
there is no synchronization with each call anymore.

Is that understandable?

I'm not saying "you must install groovy" , I just want to be sure having a scripting engine
with "script compilation caching" working (or without any synchronization during runtime).

Greetings Danny

View raw message