-
-
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
jruby 9.0.0.0.rc1 performance regressions #3121
Comments
I forgot to state my reference system is a Lenovo laptop, I5 cpu, 6GB ram, using PCLinuxOS 32-bit Linux distro. But I see similar performance in other 64-bit distros using Virtual Box. jz |
Wow this is a beast of a benchmark! JRuby performance regression aside, I would imagine your current benchmark is running this in the interpreter because you are only calling each method twice. Unless a Ruby implementation has on-stack-replacement in their JIT (most do not), or some kind of tracing, there isn't really an opportunity to optimise here. |
I tried a much smaller prime, and I hope the smaller prime is still correct for what you are trying to achieve? 1.7
9k
Note that 9k is a lot better on |
I'd post Truffle results btw but we have a compiler bug that stops us compiling |
Ah, I can get Truffle working. Truffle
Between 1.2x (Miller-Rabin) and 21x (prime_division) faster. |
|
Would there be interest in adding this to the benchmark suite? |
The Miller-Rabin implementation for this benchmark was old code.
|
I'll attempt to get updated numbers today. |
Here's current numbers with JRuby 1.7.21 and 9k master (9.0.5.0): 1.7.21:
9.0.5.0
Most of the numbers are still slower on master. I'll poke at it a little today. |
Numbers after a few rounds of this bench do improve. 1.7.21, with invokedynamic this time, 3rd iteration:
9.0.5.0, with invokedynamic this time, 4th iteration:
After warmup, it's kinda a toss-up between the two. I suspect the final two may be faster because JRuby ships a newer version of the |
Since the original report was that JRuby 9k was 1.5 to 2.5x slower than 1.7, and I've shown above that it's more like 1.1x slower without warmup, and possibly the same or faster with warmup, I'm going to call this one fixed. Obviously there's more we can do to improve performance, but at this point, for this example, I would say our regression is largely gone. |
In running a cpu heavy math benchmark against 1.7.20.1 and 9.0.0.0.rc1 I've observed a significant performance regression. The 9.0.0.0.rc1 times are 1.5 to 2.5 slower than for 1.7.20.1.
Here is a gist of the benchmark, justdo load 'primalitytest.rb' and it will run.
https://gist.github.com/jzakiya/9befd7eb5ed9640f9358
This code became the precursor to a gem I released on April 1, 2015 -- primes-utils.
I see the same performance degradation with its methods as with the above benchmark methods.
I know 9.0.0.0 is still a first release candidate but this seems very extreme to me.
jz
The text was updated successfully, but these errors were encountered: