[armedbear-devel] SLOW enumeration of scripting engines via JSR 223 interface...

Ville Voutilainen ville.voutilainen at gmail.com
Sat Nov 27 21:10:05 UTC 2010

On 27 November 2010 19:51, Martin Hepperle
<Martin.Hepperle at mh-aerotools.de> wrote:
> Hi,
> embedding ABCL using JSR 223 scripting interface I see an nnoyingly long
> startup time for instances of the ScriptEngineFactory. This is annoying, as
> e.g. just enumerating all available scrip engines takes rather long because
> ABCL peforms its complete initailization when I only want to see what its
> name and script file extensions are.
> In the class AbclScriptEngineFactory there is a  static field which holds a
> singleeton instance of the script engine:
> private static final AbclScriptEngine THE_ONLY_ONE_ENGINE = new
> AbclScriptEngine();
> This field is unneccesarily instantiated as soon as the class
> AbclScriptEngineFactory is instantiated.
> It would be preferred to intantiate the cript engine only when actually
> needed, i.e. in getScriptEngine() and instead set it to null so that
> THE_ONLY_ONE_ENGINE can be tested agianst null inside getScriptEngine().

First of all, thanks for the report! Fix committed on trunk as r13059. We will
try and backport it for 0.23.1.

Just out of curiosity, what are you using JSR-223 for? Some of us abcl
believe it's one of our greatest features, we've been looking for
users for it. :)

More information about the armedbear-devel mailing list