Using multiple interpreters vs reusing one

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Using multiple interpreters vs reusing one

Bulat Yaminov
Hi everybody!

I'm developing an application where Jython scripts would be executed once in a while as part of executing a workflow of tasks. So the number of tasks and the time when they execute can be random and depends on the users' input. In any case it can happen in parallel.

The question is, should I better create a separate new engine for each scripts, like in "new ScriptEngineManager().getEngineByName(PYTHON_ENGINE)". Or should I instead create the engine once globally for my application and then just call "jythonEngine.eval(script, scriptContext)" whenever running a user's task?

Maybe creating a new engine for each execution would be much slower? Or maybe reusing the engine could lead to some isolation problems?

Thanks in advance for your comments!

Bulat Yaminov

Check out the vibrant tech community on one of the world's most
engaging tech sites,!
Jython-users mailing list
[hidden email]