Charles Oliver Nutter created JRUBY-6299:
--------------------------------------------

             Summary: Slow perf in String#split or #join on 1.9 mode
                 Key: JRUBY-6299
                 URL: https://jira.codehaus.org/browse/JRUBY-6299
             Project: JRuby
          Issue Type: Bug
          Components: Performance, Ruby 1.9.2, Windows
    Affects Versions: JRuby 1.6.5, JRuby 1.7
            Reporter: Charles Oliver Nutter


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:

{noformat}

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)
{noformat}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to