[graalvm-users] Migrate from Nashhorn JSR 223 Scripting Engine to Graal

Andreas Mueller am at iit.de
Fri Jun 22 11:34:25 PDT 2018

Hi Christian,

> Did you try if it worked if you annotated it? Or is your code (or relevant parts of it) open-source so we can run it ourselves?

I didn’t test it yet. It’s not open source either (the scripts are under Apache 2 but the SwiftMQ is not). 

The scripts are using a SwiftMQ Stream Interface (the Java part provided by SwiftMQ). The intention is to use any JSR 223 available scripting engine so that scripts (SwiftMQ Steeams) can be written in JS, Groovy, Scala, Python etc. We have only tested (and implemented it) in JS. So I can add annotattions but would rather appreciated if you don’t require them at all.

Javadoc of the Stream Interface, FYI (sometimes we just use a Runnable as the callback interface):


> > What we need is in fact a Nashorn replacement as a scripting engine as part of the JDK
> > or as a plugin into the JDK by adding it to the classpath.
> Executing Graal JavaScript on a stock JDK is possible already (without Graal as optimizing compiler), and we are working on a fully-performant solution for JDK 11 (with Graal). Graal JavaScript tries to be closely compatible to Nashorn, but it is unrealistic that it ever provides 100% compatibility. Feedback like yours helps us understand what users care about most.

We have a lot of scripts we can test again GraalVM, no problem. Just post it when you have a new release and I’ll give it a try.

> > Nashorn’s performance is ok for us but an increase would be much
> > appreciated. Are there plans to provide that?
> Graal JavaScript is significantly faster than Nashorn on most peak performance benchmarks (often orders of magnitude faster). But please note the difference: Nashorn always compiles the JavaScript code it executes to bytecode. Graal JavaScript requires Graal as optimizing compiler to achive good performance. The setup you are testing right now does not include Graal, so in your case, JavaScript is only interpreted, thus you will experience a performance impact.

Interpreted is not an option for us.

Andreas Mueller
IIT Software GmbH

IIT Software GmbH
Falkenhorst 11, 48155 Münster, Germany
Phone: +49 (0)251 39 72 99 00
Managing Director: Andreas Müller
District Court: Amtsgericht Münster, HRB 16294
VAT-No: DE199945912

This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://oss.oracle.com/pipermail/graalvm-users/attachments/20180622/31fdfd2c/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: swiftmq_logo_positiv.png
Type: image/png
Size: 10241 bytes
Desc: not available
Url : http://oss.oracle.com/pipermail/graalvm-users/attachments/20180622/31fdfd2c/attachment.png 

More information about the GraalVM-Users mailing list