compile.invokedynamic on yields a 26% speedup for JRuby 126.96.36.199, shaving more than a minute from the time needed to execute the workload!
Furthermore, we can also see how JRuby performance has slightly improved in a year, between JRuby 188.8.131.52 (released in January of 2016) and JRuby 184.108.40.206 (released in January of 2017).
So what’s the verdict? If you’re not impacted by having longer start-up and warm-up times for your application, you should really be adding
-Xcompile.invokedynamic=true to your
JRUBY_OPTS or application startup scripts.
As for JRuby it may be time to enable this option by default again. Or at least rename it to something more awesome-sounding, like
Update, 11th May 2017: Recently, while I was benchmarking a web application using JRuby, I discovered a use case where code using
compile.invokedynamic ran noticeably slower than when that option was disabled.
Turns out it was a bug, which the JRuby developers fixed awesomely quickly, making
compile.invokedynamic again faster than the non-invokedynamic code path. So, if you find any such instances, do report!