Poor performance with invokedynamic on Graal
Charles Oliver Nutter
headius at headius.com
Sat Aug 6 00:35:53 UTC 2016
Hey all!
I've started to poke at running JRuby on Graal and I've been pretty
disappointed with the results so far. It appears that Graal is not doing a
good job of optimizing through invokedynamic call sites, which largely
defeats our best opportunity for optimization.
I've tried two benchmarks today against graal-core HEAD.
The first is trivial: a recursive fib benchmark. JRuby+indy on Hotspot
(8u92) runs fib(35) in around 0.32s. JRuby+indy on Graal takes 0.52s or so
per iteration.
https://gist.github.com/headius/492fb995e15b50d3db42145339f21968
The second benchmark is more robust: a pure-Ruby red/black tree
implementation. The benchmark builds up a large tree, searches it, deletes
from it, etc. JRuby+indy on Hotspot can run an iteration in about 0.41s. On
Graal, it takes 1s or more.
This is all especially unfortunate because some time ago I was able to see
a 5x improvement on a mandelbrot benchmark. I don't see that on recent
Graal builds.
Here's how to reproduce...
* Grab a master build of JRuby from http://ci.jruby.org. Look for
9.1.3.0-snapshot "bin" tarball.
* Unpack, add bin/ to PATH so JRuby gets picked up.
* Run the benchmarks I've gisted below.
https://gist.github.com/headius/5eb47848fbe486266942695891b0d9f6
Let me know if you have question! I want to see this run as well as I
believe it should!
- Charlie
More information about the graal-dev
mailing list