Skip to content
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

Perf degradation in kalman filter implementation #3112

Open
headius opened this issue Jul 7, 2015 · 2 comments
Open

Perf degradation in kalman filter implementation #3112

headius opened this issue Jul 7, 2015 · 2 comments

Comments

@headius
Copy link
Member

headius commented Jul 7, 2015

See rubinius/rubinius#3447 for the original report.

The numbers on JRuby 9k.rc2 non-indy are still lower than 1.7.x, but the indy numbers are faster. There's probably some low-hanging fruit in the non-indy JIT that could fix this.

Despite the original report, neither JRuby 1.7 nor 9k appear to be slower than MRI now, but the 9k non-indy results warrant investigation.

[] ~/projects/jruby/fea3892507db7bf3d1d0 $ rvm jruby-1.7.20 do jruby filter_ips.rb 
jruby 1.7.20 (1.9.3p551) 2015-05-04 3086e6a on Java HotSpot(TM) 64-Bit Server VM 1.8.0_45-b14 +jit [darwin-x86_64]
Calculating -------------------------------------
              kalman   432.000  i/100ms
-------------------------------------------------
              kalman      9.446k (± 6.5%) i/s -     94.176k

[] ~/projects/jruby/fea3892507db7bf3d1d0 $ jruby filter_ips.rb 
jruby 9.0.0.0-SNAPSHOT (2.2.2) 2015-07-06 bce9d5c Java HotSpot(TM) 64-Bit Server VM 25.45-b02 on 1.8.0_45-b14 +jit [darwin-x86_64]
Calculating -------------------------------------
              kalman   362.000  i/100ms
-------------------------------------------------
              kalman      7.927k (± 7.3%) i/s -     78.916k

[] ~/projects/jruby/fea3892507db7bf3d1d0 $ rvm jruby-1.7.20 do jruby -Xcompile.invokedynamic=true filter_ips.rb 
jruby 1.7.20 (1.9.3p551) 2015-05-04 3086e6a on Java HotSpot(TM) 64-Bit Server VM 1.8.0_45-b14 +indy +jit [darwin-x86_64]
Calculating -------------------------------------
              kalman   123.000  i/100ms
-------------------------------------------------
              kalman     11.559k (±23.0%) i/s -    104.304k

[] ~/projects/jruby/fea3892507db7bf3d1d0 $ jruby -Xcompile.invokedynamic=true filter_ips.rb 
jruby 9.0.0.0-SNAPSHOT (2.2.2) 2015-07-06 bce9d5c Java HotSpot(TM) 64-Bit Server VM 25.45-b02 on 1.8.0_45-b14 +indy +jit [darwin-x86_64]
Calculating -------------------------------------
              kalman   179.000  i/100ms
-------------------------------------------------
              kalman     12.413k (±15.6%) i/s -    118.856k

[] ~/projects/jruby/fea3892507db7bf3d1d0 $ rvm ruby-2.2 do ruby filter_ips.rb 
ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-darwin14]
Calculating -------------------------------------
              kalman   615.000  i/100ms
-------------------------------------------------
              kalman      6.202k (± 4.6%) i/s -     62.115k
@headius
Copy link
Member Author

headius commented Jul 7, 2015

A more extensive comparison, alternating between 1.7.20 and HEAD over various settings:

https://gist.github.com/headius/5d0ed029532d745c7fd7

A few observations:

  • Indy perf with threshold=0 appears to be identical on both versions
  • This longer ips run (20s instead of 10s narrows the gap on non-indy perf measures, but 9k is still behind by 15% or so.
  • The interpreter in 9k is significantly slower on this benchmark than 1.7.20.

Given this, it seems like focusing on interpreter perf would be the best first target, followed by JVM6 JIT performance.

@headius
Copy link
Member Author

headius commented Jul 7, 2015

It doesn't address the perf degradation, but I made a few small tweaks to matrix.rb for performance: https://gist.github.com/headius/317e7bf0617cff8e92e7

With this, the indy jit=0 numbers go up to 22.7k ips, compared to previous 11-12k and 6.2k for MRI.

There's obviously a lot that could be done to speed up matrix.rb.

@enebo enebo modified the milestone: JRuby 9.0.0.0 Jul 14, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants