Details

    • Number of attachments :
      0

      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)
      

        Activity

        Hide
        Charles Oliver Nutter added a comment -

        There's also something seriously wrong with this on Java 7. It wouldn't even complete for me.

        Show
        Charles Oliver Nutter added a comment - There's also something seriously wrong with this on Java 7. It wouldn't even complete for me.
        Hide
        Charles Oliver Nutter added a comment -

        Nevermind about Java 7. I thought something was wrong, but it actually just happens to use more than 500M of memory. It's probably right on the edge when running on Java 6.

        Show
        Charles Oliver Nutter added a comment - Nevermind about Java 7. I thought something was wrong, but it actually just happens to use more than 500M of memory. It's probably right on the edge when running on Java 6.
        Hide
        Charles Oliver Nutter added a comment -

        Note that the massive memory use of this benchmark could also be to blame; it may simply be more of a String-creation benchmark than a split/join benchmark.

        Show
        Charles Oliver Nutter added a comment - Note that the massive memory use of this benchmark could also be to blame; it may simply be more of a String-creation benchmark than a split/join benchmark.
        Hide
        Charles Oliver Nutter added a comment -

        The memory use needs to be compensated for, or the benchmark runs much slower than it should. With enough memory, however, we're faster than 1.9.3 across the board in either 1.8 or 1.9 modes.

        https://gist.github.com/3233714

        Show
        Charles Oliver Nutter added a comment - The memory use needs to be compensated for, or the benchmark runs much slower than it should. With enough memory, however, we're faster than 1.9.3 across the board in either 1.8 or 1.9 modes. https://gist.github.com/3233714

          People

          • Assignee:
            Charles Oliver Nutter
            Reporter:
            Charles Oliver Nutter
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: