-
-
Notifications
You must be signed in to change notification settings - Fork 942
Closed
Labels
Milestone
Description
We must be doing too much work in the String operations called by bench_threaded_reverse.rb, since our performance is absolutely dismal compared to MRI 1.9.3:
JRuby 1.8 mode:
system ~/projects/jruby $ jruby --1.8 bench/bench_threaded_reverse.rb 1
concurrency is - 1
started thread 0
Thread 0 running
another 10 in #<Thread:0x1ad5cabc run>
another 10 in #<Thread:0x1ad5cabc run>
another 10 in #<Thread:0x1ad5cabc run>
another 10 in #<Thread:0x1ad5cabc run>
another 10 in #<Thread:0x1ad5cabc run>
another 10 in #<Thread:0x1ad5cabc run>
another 10 in #<Thread:0x1ad5cabc run>
another 10 in #<Thread:0x1ad5cabc run>
another 10 in #<Thread:0x1ad5cabc run>
another 10 in #<Thread:0x1ad5cabc run>
another 10 in #<Thread:0x1ad5cabc run>
another 10 in #<Thread:0x1ad5cabc run>
Thread 0 done
Time: 1.47
JRuby 1.9 mode:
system ~/projects/jruby $ jruby --1.9 -v bench/bench_threaded_reverse.rb 1
concurrency is - 1
started thread 0
Thread 0 running
another 10 in #<Thread:0x2d14d18f run>
another 10 in #<Thread:0x2d14d18f run>
another 10 in #<Thread:0x2d14d18f run>
another 10 in #<Thread:0x2d14d18f run>
another 10 in #<Thread:0x2d14d18f run>
another 10 in #<Thread:0x2d14d18f run>
another 10 in #<Thread:0x2d14d18f run>
another 10 in #<Thread:0x2d14d18f run>
another 10 in #<Thread:0x2d14d18f run>
another 10 in #<Thread:0x2d14d18f run>
another 10 in #<Thread:0x2d14d18f run>
another 10 in #<Thread:0x2d14d18f run>
Thread 0 done
Time: 142.184
MRI 1.9.3:
system ~/projects/jruby $ ruby1.9.3 bench/bench_threaded_reverse.rb 1
concurrency is - 1
started thread 0
Thread 0 running
another 10 in #<Thread:0x000001008e3770 run>
another 10 in #<Thread:0x000001008e3770 run>
another 10 in #<Thread:0x000001008e3770 run>
another 10 in #<Thread:0x000001008e3770 run>
another 10 in #<Thread:0x000001008e3770 run>
another 10 in #<Thread:0x000001008e3770 run>
another 10 in #<Thread:0x000001008e3770 run>
another 10 in #<Thread:0x000001008e3770 run>
another 10 in #<Thread:0x000001008e3770 run>
another 10 in #<Thread:0x000001008e3770 run>
another 10 in #<Thread:0x000001008e3770 run>
another 10 in #<Thread:0x000001008e3770 run>
Thread 0 done
Time: 4.026808
The main body of the benchmark basically does a manual string reversal by walking individual characters. I would expect it to be slower than 1.8, due to encoding checks, but obviously it's much slower than it should be.
Reactions are currently unavailable