-
Notifications
You must be signed in to change notification settings - Fork 190
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
Graal JS Script Engine is very slow compared to Rhino #836
Comments
Please note that this is not about graalvm being slower ( which it is - around 12+% with respect to Temurin 21.). Graal VM
Temurin VM
Thus the slowness in the fist comment is entirely due to graalvm's way pf handling script engines and loading and running compiled scripts. |
Did you test GraalJS with Temurin as well? |
No.. I ran Graal against Graal and.. Rhino in Temurin! Sure I can try running Graal in Temurin. |
Or maybe just change the title to “GraalJS on GraalVm slower than Rhino on Temurin”. I do suspect it is caused be the scaffolding, maybe creating engine and context is the slow part, not the execution. Maybe you can measure that separately? (Or is that what your /z test is saying?) |
We have this https://github.com/nmondal/cowj where we use js engines.
We have ran some tests and in summary, when we use Graal Script Engine + GraalVM, it is very, very slow compared to Rhino + Temurin 21 VM.
To reproduce:
graal
gradle clean build -x test
app/build/libs
folder andjava -jar cowj-0.1-SNAPSHOT.jar ../../samples/hello/hello.yaml true
gava -Dpolyglot.js.nashorn-compat=true -jar cowj-0.1-SNAPSHOT.jar ../../samples/hello/hello.yaml true
wrk --latency -t12 -c400 -d30s http://127.0.0.1:5003/hello/j
We used
wrk
tool from here ( https://github.com/wg/wrk )The script file
hello.js
contains the following:It just returns "hello, world!"
We found out that graal is very slow compared to Rhino.
Attached are the benchmark results.
In summary, the best performance for these two:
GRAAL
Rhino
This is a HUGE gap, order of magnitude high gap.
Notes
Build was done using temurin open jdk 21
graalvm.perf.txt
rhino.perf.txt
The text was updated successfully, but these errors were encountered: