Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for GraalJS script engine as possible replacement for the deprecated Nashorn #96

Open
sdoeringNew opened this issue Nov 11, 2020 · 1 comment

Comments

@sdoeringNew
Copy link
Contributor

With Java 15 Nashorn was finally removed from the JDK. But with GraalJS there is some sort of replacement.

If the application runs with the polyglot GraalVM there is out of the box support for GraalJS.
Or GraalJS and its ScriptEngine could be simply added as dependency and ran with the JDK.

@sdoeringNew
Copy link
Contributor Author

But there is one caveat.

JavaScript is single threaded. Rhino and Nashorn haven't cared but GraalJS does. Multi-threaded access to the same context will result in an exception.

See: https://www.graalvm.org/reference-manual/js/Multithreading/

One of the recommendations is proper synchronization. And I think I'll go with that. A synchronized access to the GraalJS script engine shall still be faster than multi-threaded Rhino. GraalJS is magnitudes faster than Rhino.

sdoeringNew added a commit to sdoeringNew/json-schema-core that referenced this issue Nov 16, 2020
sdoeringNew added a commit to sdoeringNew/json-schema-core that referenced this issue Nov 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant