-
-
Notifications
You must be signed in to change notification settings - Fork 925
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
[Truffle] while loops not being optimized? #3308
Comments
If you use Running from a file works more reliably: require 'benchmark'
def abc
count = 0
while count < 100000000
count = count + 1
end
puts count
end
5.times { puts Benchmark.measure { abc } }
# run with jt ruby --graal test.rb But there seems to currently be a bug with On-Stack-Replacement (a relatively new feature) + background compilation, which sometimes just aborts the JIT and then runs in the interpreter. One way to currently make it work reliably in IRB is to disable background compilation:
|
@eregon I still must be doing something wrong. First, I've recompiled jruby using the Then I copied your code into
And the results were:
So no real improvements yet. |
@brauliobo Compilation of JRuby is fine with any javac >= 1.7, so it's not needed. Which version of Graal did you download? 0.7? Could you try running from a file? IRB is not an ideal environment for benchmarks.
|
@eregon graal version 0.8 ( Runned
|
@brauliobo We are using Graal 0.7 on the master branch, so you need that version instead. Can you try with Graal 0.7? |
ok, worked now! sorry for the misunderstading
|
Great! |
@brauliobo if you are experimenting with Truffle, join us in #jruby on IRC or https://gitter.im/jruby and if you are in a EU or US time zone there will normally be someone there who can help you in real time. |
thanks @chrisseaton! I've messaged you on #jruby channel. The gitter room is private. I willing to fix some easy to fix failing specs on jruby+truflle. |
Under
jt irb
, I ran thisabc
method a few times:And it took ages to finish. Under MRI 2.2.3 it takes 2.6s.
Is there some optimization I'm missing? I have configured
export JAVACMD=graalvm-jdk1.8.0/bin/java
and can see this on the irb's process.The text was updated successfully, but these errors were encountered: