-
Task
-
Resolution: Fixed
-
P4
-
13
-
None
-
b06
-
generic
-
generic
Optimistic types in Nashorn were enabled by default in JDK 9 by JDK-8060015 (technically a "backport" of JDK-8059811 which disabled it by default in JDK 8).
Since then, user feedback and bug reports have shown that most common use of Nashorn seems to be running scripts that belong to the Node ecosystem and are part of the web developer toolchain. These scripts are often very large and complex, and usually run for a short time (script is executed once to perform some sort of conversion/compilation).
Optimistic types are very detrimental in this kind of scenario, because Nashorn spends a lot of time optimizing and recompiling code that is only run once.
Moreover, optimistic types are very complex and are the part of Nashorn that has received the least hardening/bug fixing.JDK-8222205 is just one example where a bug is caused by optimistic types and can be worked around by disabling the feature.
On the basis of these facts, we should consider turning the default for optimistic types off in JDK 13 for the remaining lifespan of Nashorn. To summarize, the benefits would be:
- Quicker execution of run-once scripts
- Significant avoidance of bugs in script recompilation
- Minimal risk of adding bugs that only manifest in non-optimistic mode
Since then, user feedback and bug reports have shown that most common use of Nashorn seems to be running scripts that belong to the Node ecosystem and are part of the web developer toolchain. These scripts are often very large and complex, and usually run for a short time (script is executed once to perform some sort of conversion/compilation).
Optimistic types are very detrimental in this kind of scenario, because Nashorn spends a lot of time optimizing and recompiling code that is only run once.
Moreover, optimistic types are very complex and are the part of Nashorn that has received the least hardening/bug fixing.
On the basis of these facts, we should consider turning the default for optimistic types off in JDK 13 for the remaining lifespan of Nashorn. To summarize, the benefits would be:
- Quicker execution of run-once scripts
- Significant avoidance of bugs in script recompilation
- Minimal risk of adding bugs that only manifest in non-optimistic mode
- relates to
-
JDK-8222205 java.lang.NullPointerException when using jjs with r.js
-
- Resolved
-