Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: JRuby 1.2
    • Component/s: Performance
    • Labels:
      None
    • Number of attachments :
      0

      Description

      See the bench here: http://github.com/djwhitt/rstone/tree/master

      It's a good bit slower on JRuby than on 1.9; something's amiss.

        Activity

        Hide
        Charles Oliver Nutter added a comment -

        After warmup, things definitely look better, but still not as fast as 1.9:

        [headius @ cnutter:~/projects/jruby]
        ◆ jruby rstone.rb 
        Rstone time for 100000 passes = 3.030544
        This machine benchmarks at 32997.37604865661 rstones/second
        Rstone time for 100000 passes = 1.780403
        This machine benchmarks at 56167.0588063489 rstones/second
        Rstone time for 100000 passes = 1.652289
        This machine benchmarks at 60522.0999474063 rstones/second
        Rstone time for 100000 passes = 1.644329
        This machine benchmarks at 60815.0801938055 rstones/second
        Rstone time for 100000 passes = 1.652234
        This machine benchmarks at 60524.11462298924 rstones/second
        [headius @ cnutter:~/projects/jruby]
        ◆ ruby1.9 rstone.rb 
        Rstone time for 100000 passes = 1.484223
        This machine benchmarks at 67375.3202854288 rstones/second
        Rstone time for 100000 passes = 1.480326
        This machine benchmarks at 67552.6877187863 rstones/second
        Rstone time for 100000 passes = 1.487314
        This machine benchmarks at 67235.2979935642 rstones/second
        Rstone time for 100000 passes = 1.489737
        This machine benchmarks at 67125.9423643234 rstones/second
        Rstone time for 100000 passes = 1.4992
        This machine benchmarks at 66702.2411953042 rstones/second
        

        I suspect there may be some 1.9-specific optimizations at play here.

        Show
        Charles Oliver Nutter added a comment - After warmup, things definitely look better, but still not as fast as 1.9: [headius @ cnutter:~/projects/jruby] ◆ jruby rstone.rb Rstone time for 100000 passes = 3.030544 This machine benchmarks at 32997.37604865661 rstones/second Rstone time for 100000 passes = 1.780403 This machine benchmarks at 56167.0588063489 rstones/second Rstone time for 100000 passes = 1.652289 This machine benchmarks at 60522.0999474063 rstones/second Rstone time for 100000 passes = 1.644329 This machine benchmarks at 60815.0801938055 rstones/second Rstone time for 100000 passes = 1.652234 This machine benchmarks at 60524.11462298924 rstones/second [headius @ cnutter:~/projects/jruby] ◆ ruby1.9 rstone.rb Rstone time for 100000 passes = 1.484223 This machine benchmarks at 67375.3202854288 rstones/second Rstone time for 100000 passes = 1.480326 This machine benchmarks at 67552.6877187863 rstones/second Rstone time for 100000 passes = 1.487314 This machine benchmarks at 67235.2979935642 rstones/second Rstone time for 100000 passes = 1.489737 This machine benchmarks at 67125.9423643234 rstones/second Rstone time for 100000 passes = 1.4992 This machine benchmarks at 66702.2411953042 rstones/second I suspect there may be some 1.9-specific optimizations at play here.
        Hide
        Charles Oliver Nutter added a comment -

        Setting some optz flags improves performance for us, putting it ahead of 1.9. So I think largely this different can be explained by differing optimizations in JRuby and 1.9...

        $ jruby -J-Djruby.compile.fastops=true -J-Djruby.compile.threadless=true -J-Djruby.compile.positionless=true rstone.rb 
        Rstone time for 100000 passes = 2.67053
        This machine benchmarks at 37445.750469008024 rstones/second
        Rstone time for 100000 passes = 1.5602660000000002
        This machine benchmarks at 64091.63565699694 rstones/second
        Rstone time for 100000 passes = 1.462569
        This machine benchmarks at 68372.84258041842 rstones/second
        Rstone time for 100000 passes = 1.445832
        This machine benchmarks at 69164.32891234943 rstones/second
        Rstone time for 100000 passes = 1.440506
        This machine benchmarks at 69420.05100985347 rstones/second
        
        Show
        Charles Oliver Nutter added a comment - Setting some optz flags improves performance for us, putting it ahead of 1.9. So I think largely this different can be explained by differing optimizations in JRuby and 1.9... $ jruby -J-Djruby.compile.fastops=true -J-Djruby.compile.threadless=true -J-Djruby.compile.positionless=true rstone.rb Rstone time for 100000 passes = 2.67053 This machine benchmarks at 37445.750469008024 rstones/second Rstone time for 100000 passes = 1.5602660000000002 This machine benchmarks at 64091.63565699694 rstones/second Rstone time for 100000 passes = 1.462569 This machine benchmarks at 68372.84258041842 rstones/second Rstone time for 100000 passes = 1.445832 This machine benchmarks at 69164.32891234943 rstones/second Rstone time for 100000 passes = 1.440506 This machine benchmarks at 69420.05100985347 rstones/second
        Hide
        Charles Oliver Nutter added a comment -

        FYI, the project has moved here:

        http://github.com/djwhitt/retrobench/tree/master

        And it looks like we're doing well compared to Ruby 1.9 now, so I'm going to resolve this bug:

        [headius @ cnutter:~/projects/retrobench]
        $ ruby1.9 rstone.rb 10000000
        Rstone time for 10000000 passes = 150.775785
        This machine benchmarks at 66323.647394706 rstones/second
        [headius @ cnutter:~/projects/retrobench]
        $ jruby rstone.rb 10000000
        Rstone time for 10000000 passes = 127.566
        This machine benchmarks at 78390.7937851779 rstones/second
        [headius @ cnutter:~/projects/retrobench]
        $ jruby --fast rstone.rb 10000000
        Rstone time for 10000000 passes = 109.735
        This machine benchmarks at 91128.6280585046 rstones/second
        
        Show
        Charles Oliver Nutter added a comment - FYI, the project has moved here: http://github.com/djwhitt/retrobench/tree/master And it looks like we're doing well compared to Ruby 1.9 now, so I'm going to resolve this bug: [headius @ cnutter:~/projects/retrobench] $ ruby1.9 rstone.rb 10000000 Rstone time for 10000000 passes = 150.775785 This machine benchmarks at 66323.647394706 rstones/second [headius @ cnutter:~/projects/retrobench] $ jruby rstone.rb 10000000 Rstone time for 10000000 passes = 127.566 This machine benchmarks at 78390.7937851779 rstones/second [headius @ cnutter:~/projects/retrobench] $ jruby --fast rstone.rb 10000000 Rstone time for 10000000 passes = 109.735 This machine benchmarks at 91128.6280585046 rstones/second

          People

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

            Dates

            • Created:
              Updated:
              Resolved: