You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We were so far using Jython as an embedded script engine in a bigger Java application shipped with OpenJDK 25.
Many embedded computations are small math expressions that our users provide as custom code, which operate with high repetition on some foreign variables passed from Java (e.g. to compute the plotted y-coordinate of a mathematical function).
We have replaced the script engine with GraalPy, but the performance is 4-12 times slower than Jython.
Switching the whole application to execute on GraalVM is no option. I tried to wrap Java variables into Polyglot proxies by hand, but with limited success. One crucial "brake" I could remove by disabling Java assertions, which causes a lot of muffled Exceptions in the interpreter.
I also tried to configure the use of python isolates (and hit a paywall), added -XX:+EnableJVMCI but with no visible success.
Is there something I have missed to try?
It seems that Jython is finally boiled down to JVM bytecode (complicated, with a lot of Map accesses), that in our typical examples can be optimized and JIT compiled by HotSpot, while the Graalpy byteCodeLoop runs on Python bytecode and HotSpot can not figure out optimizations for that.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
We were so far using Jython as an embedded script engine in a bigger Java application shipped with OpenJDK 25.
Many embedded computations are small math expressions that our users provide as custom code, which operate with high repetition on some foreign variables passed from Java (e.g. to compute the plotted y-coordinate of a mathematical function).
We have replaced the script engine with GraalPy, but the performance is 4-12 times slower than Jython.
Switching the whole application to execute on GraalVM is no option. I tried to wrap Java variables into Polyglot proxies by hand, but with limited success. One crucial "brake" I could remove by disabling Java assertions, which causes a lot of muffled Exceptions in the interpreter.
I also tried to configure the use of python isolates (and hit a paywall), added -XX:+EnableJVMCI but with no visible success.
Is there something I have missed to try?
It seems that Jython is finally boiled down to JVM bytecode (complicated, with a lot of Map accesses), that in our typical examples can be optimized and JIT compiled by HotSpot, while the Graalpy byteCodeLoop runs on Python bytecode and HotSpot can not figure out optimizations for that.
All reactions