Hello,
For the last 11 months, this ticket has existed:
Groovy has GroovyScriptEngine (non JSR223 compliant) and GroovyScriptEngineImpl (JSR223 compliant). While you may think they are similar, they are widely different. I took the easy route with Gremlin and simply extended GroovyScriptEngineImpl to "Gremlin-ify" the Groovy engine and allow applications from other JVM languages to easily talk to Gremlin.
This easy route lead to a very inefficient JSR223 implementation that required reloading of imports on every eval() call. Horribly inefficient -- ~100+ms wasted on loading the imports for each call. For some work we are doing with Rexster (massive concurrency + binary protocol), we needed to make eval() fast. I was lucky enough to find a mapping between GroovyScriptEngine and GroovyScriptEngineImpl developed by some Google engineers.
I greatly adopted this code and we now have a wicked fast JSR223 implementation.
We are now looking at eval() load times of less than 1 ms. (from ~100 ms).
Thanks James and i000 for spurning the issue,
Marko.