Skip to content
This repository has been archived by the owner on May 22, 2024. It is now read-only.

GraalJS significantly slower than Nashorn when running on OpenJ9 JVM #37

Open
thjaeckle opened this issue Nov 20, 2020 · 2 comments
Open
Assignees

Comments

@thjaeckle
Copy link

When running against OpenJ9 JVM (JDK11)

me@ubuntu:~/git/graal-js-jdk11-maven-demo$ export JAVA_HOME=/usr/lib/jvm/adoptopenjdk-11-openj9-amd64
me@ubuntu:~/git/graal-js-jdk11-maven-demo$ mvn package

I get the following output:

=== Nashorn via javax.script.ScriptEngine ===
Warning: Nashorn engine is planned to be removed from a future JDK release
warming up ...
warmup finished, now measuring
iteration: 515
iteration: 497
iteration: 515
iteration: 463
iteration: 503
iteration: 520
iteration: 467
iteration: 464
iteration: 479
iteration: 473
=== Graal.js via org.graalvm.polyglot.Context === 
warming up ...
warmup finished, now measuring
iteration: 2856
iteration: 2811
iteration: 2888
iteration: 2874
iteration: 2825
iteration: 2822
iteration: 2978
iteration: 2895
iteration: 3073
iteration: 2926
=== Graal.js via javax.script.ScriptEngine ===
warming up ...
warmup finished, now measuring
iteration: 3091
iteration: 3070
iteration: 2812
iteration: 2952
iteration: 2858
iteration: 2862
iteration: 2842
iteration: 2832
iteration: 2748
iteration: 2823

[ERROR] Failures: 
[ERROR]   AppTest.testGraalPolyglotSpeed:61 Graal.js (2926 ms) should be faster than Nashorn (473 ms).
[ERROR]   AppTest.testGraalScriptEngineSpeed:70 Graal.js (2823 ms) should be faster than Nashorn (473 ms).

When running with hotspot, GraalJS beats Nashorn (and is overall faster than with OpenJ9 JVM).
It this an known/expected result?

@mwisnicki
Copy link

From what I understand GraalJS runs in pure interpreter mode when not running on GraalVM (which it autoenables in the pom for jdk11). Nashorn compiles JS to JVM bytecode.

@antsfiles
Copy link

I confirm it's far slower on jdk 8 or 11.

Plus I was not able to use graalvm-ce-java11-22.0.0.2
Plus I was not able to run mvn exec:exec on Windows: problem with the ":" in the path?

java.nio.file.InvalidPathException: Illegal char <:> at index 73: D:\dev_test\graal-js-jdk11-maven-demo-master\target/compiler/compiler.jar:D:\dev_test\graal-js-jdk11-maven-demo-master\target/compiler/compiler-management.jar

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants