Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
Scripting JavaScript 2.0.12
-
None
Description
The Rhino Javascript engine allows you to choose the level of optimization for the generated byte code or it lets you select whether the scripts should be run in interpreted mode [0].
Currently, there is no way to configure this. By default, Rhino compiles scripts into JVM classes using the optimization level 0.
This option should be configurable, and the default value for this configuration should be "-1" - meaning run scripts in interpreted mode. Since we are not caching script compilation artifacts, the interpreted mode gives the best performance for short-running scripts.
The attached patch implements this improvement by exposing a configuration entry in the Rhino Javascript engine factory component.
[0] https://developer.mozilla.org/en-US/docs/Mozilla/Projects/Rhino/Optimization