Yay! Glad to see Pnuts win.
FWIW, CachedPnutsImpl compiles and caches scripts (using WeakHashMap) for reuse when you call load(script, context)
. Avoiding loading the script each time is much better though. If you don't need CachedPnutsImpl you should use context.setImplementation(new CompilerPnutsImpl());
to have scripts compiled to bytecode. If you don't call setImplementation then it will use PnutsImpl, which is a pure interpreter.
Groovy is quite a mess of a language. I personally would rather not have such wildly different syntax. Weird that its performance varied so much.
Use janino, it's a scripting language which compiles the script to JVM bytecode so it's just as fast as java
Many JVM languages can be compiled to bytecode. They are generally still slower though, as they are usually doing more per line of code to support fancy language features.