Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: JRuby 1.6.5, JRuby 1.7.0.pre1
-
Fix Version/s: JRuby 1.7.0.pre2
-
Component/s: Performance, Ruby 1.9.2, Windows
-
Labels:None
-
Number of attachments :
Description
On the benchmark provided here: http://kzalewski.blogspot.com/2011/12/next-na-kazdym-znaku-stringa.html
JRuby is slower on the split_map_join part of the bench. On Windows the effect appears to be even more pronounced.
We are also a bit slower on the gsub part.
Here's my results on OS X:
system ~/projects/jruby $ jruby --1.9 bench.rb
Rehearsal ------------------------------------------------------------
each_char_next (1000): 0.498000 0.000000 0.498000 ( 0.498000)
each_next! (1000): 0.114000 0.000000 0.114000 ( 0.114000)
split_map_join (1000): 0.111000 0.000000 0.111000 ( 0.111000)
gsub (1000): 0.096000 0.000000 0.096000 ( 0.096000)
each_next! (10000): 0.126000 0.000000 0.126000 ( 0.126000)
split_map_join (10000): 0.233000 0.000000 0.233000 ( 0.233000)
gsub (10000): 0.127000 0.000000 0.127000 ( 0.127000)
each_next! (100000): 1.710000 0.000000 1.710000 ( 1.710000)
split_map_join (100000): 3.793000 0.000000 3.793000 ( 3.793000)
gsub (100000): 1.130000 0.000000 1.130000 ( 1.130000)
--------------------------------------------------- total: 7.938000sec
user system total real
each_char_next (1000): 0.146000 0.000000 0.146000 ( 0.146000)
each_next! (1000): 0.006000 0.000000 0.006000 ( 0.006000)
split_map_join (1000): 0.009000 0.000000 0.009000 ( 0.009000)
gsub (1000): 0.010000 0.000000 0.010000 ( 0.010000)
each_next! (10000): 0.099000 0.000000 0.099000 ( 0.099000)
split_map_join (10000): 0.141000 0.000000 0.141000 ( 0.141000)
gsub (10000): 0.105000 0.000000 0.105000 ( 0.105000)
each_next! (100000): 1.515000 0.000000 1.515000 ( 1.515000)
split_map_join (100000): 3.899000 0.000000 3.899000 ( 3.899000)
gsub (100000): 1.688000 0.000000 1.688000 ( 1.688000)
system ~/projects/jruby $ ruby1.9.2 bench.rb
Rehearsal ------------------------------------------------------------
each_char_next (1000): 0.020000 0.000000 0.020000 ( 0.016834)
each_next! (1000): 0.020000 0.000000 0.020000 ( 0.019414)
split_map_join (1000): 0.020000 0.000000 0.020000 ( 0.018183)
gsub (1000): 0.010000 0.000000 0.010000 ( 0.015121)
each_next! (10000): 0.180000 0.010000 0.190000 ( 0.187187)
split_map_join (10000): 0.170000 0.000000 0.170000 ( 0.173868)
gsub (10000): 0.150000 0.000000 0.150000 ( 0.145752)
each_next! (100000): 1.790000 0.080000 1.870000 ( 1.864269)
split_map_join (100000): 1.790000 0.040000 1.830000 ( 1.833273)
gsub (100000): 1.430000 0.050000 1.480000 ( 1.476321)
--------------------------------------------------- total: 5.760000sec
user system total real
each_char_next (1000): 0.010000 0.000000 0.010000 ( 0.015748)
each_next! (1000): 0.020000 0.000000 0.020000 ( 0.017694)
split_map_join (1000): 0.020000 0.000000 0.020000 ( 0.017105)
gsub (1000): 0.020000 0.000000 0.020000 ( 0.014360)
each_next! (10000): 0.170000 0.000000 0.170000 ( 0.164094)
split_map_join (10000): 0.170000 0.010000 0.180000 ( 0.171303)
gsub (10000): 0.140000 0.000000 0.140000 ( 0.140985)
each_next! (100000): 1.770000 0.020000 1.790000 ( 1.786688)
split_map_join (100000): 1.670000 0.040000 1.710000 ( 1.708062)
gsub (100000): 1.380000 0.010000 1.390000 ( 1.383414)
There's also something seriously wrong with this on Java 7. It wouldn't even complete for me.