Rubinius
                               The 4th Year



Tuesday, November 24, 2009
Rubinius
                              The 1st Senior Year



Tuesday, November 24, 2009
4th Year


Tuesday, November 24, 2009
Year 1
                              Freshman Year


                              48 commits


Tuesday, November 24, 2009
http://photos.dzki.co.uk/oak_sapling_warming_itself_in_the_morning_sun.jpg
Tuesday, November 24, 2009
Year 1
                              A Toy




Tuesday, November 24, 2009
Year 1
                              An Idea




Tuesday, November 24, 2009
Year 2
                             Sophomore Year


                             2802 commits


Tuesday, November 24, 2009
Year 3
                              Hubris




Tuesday, November 24, 2009
Year 3
                              Hubris
                             1.0 anyone?




Tuesday, November 24, 2009
Year 3
                              Junior Year


                             6172 commits


Tuesday, November 24, 2009
Year 3
                             Compliance




Tuesday, November 24, 2009
Year 3
                             Compliance
                               RubySpec




Tuesday, November 24, 2009
Year 3
                             Redirection




Tuesday, November 24, 2009
Year 3
                             Redirection
                                C++




Tuesday, November 24, 2009
Year 3
                              Plotting




Tuesday, November 24, 2009
Year 4
                              1st Senior Year


                             2220 commits


Tuesday, November 24, 2...
Year 4
                               JIT




Tuesday, November 24, 2009
Year 4
                               JIT
                              LLVM




Tuesday, November 24, 2009
Year 4
                                   JIT
                             Hotspot Detection




Tuesday, November 24, 2009
Year 4
                                 JIT
                             Type Profiling




Tuesday, November 24, 2009
Year 4
                                  JIT
                             Method Inlining




Tuesday, November 24, 2009
Year 4
                                FTW
                             Block Inlining!




Tuesday, November 24, 2009
Year 4
                             RubySpec




Tuesday, November 24, 2009
Year 4
                             RubySpec
                             93% Pass Rate




Tuesday, November 24, 2009
Year 4
                              RubySpec
                             rake, rspec, rails




Tuesday, November 24, 20...
Year 4
                             C Extensions




Tuesday, November 24, 2009
Year 4
                                   C Extensions
                             syck, nokogiri, mysql, yajl-json




T...
Compliance
                                  +
                             Performance

Tuesday, November 24, 2009
Compliance
                              93+% RubySpec




Tuesday, November 24, 2009
Compliance
                                  93+% RubySpec
                             Passing/untagging more everyday


...
NotImplementedError




Tuesday, November 24, 2009
NotImplementedError
                             ObjectSpace




Tuesday, November 24, 2009
NotImplementedError
                             ObjectSpace
                                _id2ref




Tuesday, November...
NotImplementedError
                              ObjectSpace
                             each_object (limited)




Tuesd...
NotImplementedError
                             callcc




Tuesday, November 24, 2009
NotImplementedError
                             callcc
                              Yet.




Tuesday, November 24, 2009
Compliance
                                C-API




Tuesday, November 24, 2009
Compliance
                                   C-API
                              syck, nokogiri, etc.




Tuesday, Novemb...
Compliance
                                  C-API
                               A few gotchas...




Tuesday, November 2...
C Extension
                             Do’s and Don’ts



Tuesday, November 24, 2009
Do
        prefer a function over an
               R*() macro



Tuesday, November 24, 2009
Rubinius




                         RBASIC(obj)->class

                             rb_obj_class(obj)



Tuesday, Novem...
1.9 / Rubinius




                   ROBJECT(obj)->iv_tbl

                  rb_ivar_[get|set](obj, ...)




Tuesday, Nov...
1.9 / Rubinius




                             Don’t
                 use the “re.h” header




Tuesday, November 24, 2009
1.9 / Rubinius




                                   Don’t
             use the “env.h” header
                         r...
Try your gem


Tuesday, November 24, 2009
Report your
                              problems!

Tuesday, November 24, 2009
http://github.com/
 evanphx/rubinius/
        issues

Tuesday, November 24, 2009
Performance


Tuesday, November 24, 2009
Performance
                              The Two Fronts




Tuesday, November 24, 2009
Performance
                               Why We Fight
                                What We Write




Tuesday, Novembe...
(0..10).to_a.each do |i|
     ary << i
    end



Tuesday, November 24, 2009
0.upto(10) do |i|
                              ary << i
                             end



Tuesday, November 24, 2009
Performance
                              The Two Fronts
                               How We Run It




Tuesday, Novembe...
Performance
                               Benchmarking




Tuesday, November 24, 2009
Performance
                                Benchmarking
                              Expectations vs. Reality




Tuesda...
Performance
                                   Benchmarking
                             Lies, Damned Lies, and Statistics...
Benchmarks


Tuesday, November 24, 2009
114
                   Times faster than 1.8
        100



         86



         71



         57



         43



  ...
57
                   Times faster than 1.8
         50



         43



         36



         29



         21



   ...
impl           1.8      1.9    jruby    macruby    rbx



                 ms          309304   51113   113824   70580    ...
Benchmarks
                               12x faster!




Tuesday, November 24, 2009
Benchmarks
                                 12x faster!
                              On these benchmarks!




Tuesday, No...
Benchmarks
                               12x faster!
                                In general?




Tuesday, November 24...
Benchmarks
                        What did we benchmark?




Tuesday, November 24, 2009
Calling a method.
         Empty while loop.
         Creating a block.
         Accessing ivars.

                       ...
Benchmarks
                              Why these things?




Tuesday, November 24, 2009
Benchmarks
                                Why these things?
                             How do these results translate?
...
Analogy


Tuesday, November 24, 2009
Dishonest?


Tuesday, November 24, 2009
Rubinius
                             Ruby performance
                                   begets
                         ...
1.8
                             Ruby performance
                                   begets
                              ...
Benchmarks
                             Need more/better data




Tuesday, November 24, 2009
def foo()
          ary = []
          100.times { |i| ary << i }
        end




                                  300,00...
Seconds

                        8
                             7.82




                        6




                   ...
def foo()
         hsh = {}
         100.times { |i| hsh[i] = 0 }
       end




                                 100,000
...
Seconds
                       11
                                                            10.5




                   ...
def foo()
                    hsh = { 47 => true }
                    100.times { |i| hsh[i] }
                  end




...
Seconds

                        4

                             3.64



                        3


                     ...
Benchmarking
                             Conclusion




Tuesday, November 24, 2009
Benchmarking
                                     Conclusion
                             Rubinius is awesome at ruby code...
Benchmarking
                                  Conclusion
                             Comparing C/Java to Ruby




Tuesda...
More Ruby


Tuesday, November 24, 2009
More Ruby
                   Burden of our own devising




Tuesday, November 24, 2009
More Ruby
                              Fast compliance




Tuesday, November 24, 2009
More Ruby
                        Slower core performance




Tuesday, November 24, 2009
More Ruby
                        Slower core performance
                               Ruby vs. C/Java




Tuesday, Nove...
More Ruby
                              The upside...




Tuesday, November 24, 2009
114
                   Times faster than 1.8
        100



         86



         71



         57



         43



  ...
114
                   Times faster than 1.8
        100



         86



         71



         57



         43



  ...
def m; nil; end
                             def Bench.run
                              i=0
                             ...
impl           1.8    1.9    jruby   macruby   rbx



                 ms          21361   6316   10101    3295     186


...
impl           1.8    1.9    jruby   macruby    rbx



                 ms          21361   6316   10101    3295      186
...
impl           1.8    1.9    jruby   macruby   rbx



                 ms          21361   6316   10101    3295     186


...
impl           1.8    1.9    jruby   macruby   rbx



                 ms          21361   6316   10101    3295     186


...
impl           1.8    1.9    jruby   macruby   rbx



                 ms          21361   6316   10101    3295     186


...
impl           1.8    1.9    jruby   macruby   rbx




                114.8
                 ms          21361   6316   1...
Bug


Tuesday, November 24, 2009
Bug
                             right?




Tuesday, November 24, 2009
Bug


Tuesday, November 24, 2009
def m; nil; end
              def Bench.run
                i=0
                while i < 15_000_000
                  i+=...
Year 4
                                  JIT
                             Method Inlining




Tuesday, November 24, 2009
def m; nil; end
              def Bench.run
                i=0
                while i < 15_000_000
                  i+=...
bin/rbx
                   -Xjit.inline.debug
                   0/bm_vm2_method.rb




Tuesday, November 24, 2009
JIT: compiling Object#run
 inlining: primitive fixnum_lt into run.
 inlining: Object#m into run (<metaclass>)
 inlining: O...
def m; nil; end
              def Bench.run
                i=0
                while i < 15_000_000
                  i+=...
def m; nil; end
              def Bench.run
                i=0
                while i < 15_000_000
                  i+=...
Performance


Tuesday, November 24, 2009
Performance
                   Many programs, much faster




Tuesday, November 24, 2009
Performance
              Many programs, a little slower




Tuesday, November 24, 2009
Performance
                  Some programs, a lot slower




Tuesday, November 24, 2009
Releases


Tuesday, November 24, 2009
Releases
                               0.13




Tuesday, November 24, 2009
Releases
                                 0.13
                              JIT by default




Tuesday, November 24, 2009
Releases
                                 0.13
                              Lots of fixes




Tuesday, November 24, 2009
1.0rc1
Tuesday, November 24, 2009
Next Week!


Tuesday, November 24, 2009
Expectations


Tuesday, November 24, 2009
Expectations
                                Runs rails 3




Tuesday, November 24, 2009
Expectations
                    Performance improvements




Tuesday, November 24, 2009
Expectations
                             One RC every month




Tuesday, November 24, 2009
Expectations
                             One RC every month
                                 Until 1.0 is out.




Tuesda...
Upcoming SlideShare
Loading in …5
×

RubyConf 2009

2,710 views

Published on

My presentation on Rubinius at RubyConf 2009.

Published in: Technology, Education
0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
2,710
On SlideShare
0
From Embeds
0
Number of Embeds
186
Actions
Shares
0
Downloads
31
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide

RubyConf 2009

  1. 1. Rubinius The 4th Year Tuesday, November 24, 2009
  2. 2. Rubinius The 1st Senior Year Tuesday, November 24, 2009
  3. 3. 4th Year Tuesday, November 24, 2009
  4. 4. Year 1 Freshman Year 48 commits Tuesday, November 24, 2009
  5. 5. http://photos.dzki.co.uk/oak_sapling_warming_itself_in_the_morning_sun.jpg Tuesday, November 24, 2009
  6. 6. Year 1 A Toy Tuesday, November 24, 2009
  7. 7. Year 1 An Idea Tuesday, November 24, 2009
  8. 8. Year 2 Sophomore Year 2802 commits Tuesday, November 24, 2009
  9. 9. Year 3 Hubris Tuesday, November 24, 2009
  10. 10. Year 3 Hubris 1.0 anyone? Tuesday, November 24, 2009
  11. 11. Year 3 Junior Year 6172 commits Tuesday, November 24, 2009
  12. 12. Year 3 Compliance Tuesday, November 24, 2009
  13. 13. Year 3 Compliance RubySpec Tuesday, November 24, 2009
  14. 14. Year 3 Redirection Tuesday, November 24, 2009
  15. 15. Year 3 Redirection C++ Tuesday, November 24, 2009
  16. 16. Year 3 Plotting Tuesday, November 24, 2009
  17. 17. Year 4 1st Senior Year 2220 commits Tuesday, November 24, 2009
  18. 18. Year 4 JIT Tuesday, November 24, 2009
  19. 19. Year 4 JIT LLVM Tuesday, November 24, 2009
  20. 20. Year 4 JIT Hotspot Detection Tuesday, November 24, 2009
  21. 21. Year 4 JIT Type Profiling Tuesday, November 24, 2009
  22. 22. Year 4 JIT Method Inlining Tuesday, November 24, 2009
  23. 23. Year 4 FTW Block Inlining! Tuesday, November 24, 2009
  24. 24. Year 4 RubySpec Tuesday, November 24, 2009
  25. 25. Year 4 RubySpec 93% Pass Rate Tuesday, November 24, 2009
  26. 26. Year 4 RubySpec rake, rspec, rails Tuesday, November 24, 2009
  27. 27. Year 4 C Extensions Tuesday, November 24, 2009
  28. 28. Year 4 C Extensions syck, nokogiri, mysql, yajl-json Tuesday, November 24, 2009
  29. 29. Compliance + Performance Tuesday, November 24, 2009
  30. 30. Compliance 93+% RubySpec Tuesday, November 24, 2009
  31. 31. Compliance 93+% RubySpec Passing/untagging more everyday Tuesday, November 24, 2009
  32. 32. NotImplementedError Tuesday, November 24, 2009
  33. 33. NotImplementedError ObjectSpace Tuesday, November 24, 2009
  34. 34. NotImplementedError ObjectSpace _id2ref Tuesday, November 24, 2009
  35. 35. NotImplementedError ObjectSpace each_object (limited) Tuesday, November 24, 2009
  36. 36. NotImplementedError callcc Tuesday, November 24, 2009
  37. 37. NotImplementedError callcc Yet. Tuesday, November 24, 2009
  38. 38. Compliance C-API Tuesday, November 24, 2009
  39. 39. Compliance C-API syck, nokogiri, etc. Tuesday, November 24, 2009
  40. 40. Compliance C-API A few gotchas... Tuesday, November 24, 2009
  41. 41. C Extension Do’s and Don’ts Tuesday, November 24, 2009
  42. 42. Do prefer a function over an R*() macro Tuesday, November 24, 2009
  43. 43. Rubinius RBASIC(obj)->class rb_obj_class(obj) Tuesday, November 24, 2009
  44. 44. 1.9 / Rubinius ROBJECT(obj)->iv_tbl rb_ivar_[get|set](obj, ...) Tuesday, November 24, 2009
  45. 45. 1.9 / Rubinius Don’t use the “re.h” header Tuesday, November 24, 2009
  46. 46. 1.9 / Rubinius Don’t use the “env.h” header ruby_frame ruby_dyna_vars ruby_scope ruby_in_eval ruby_class Tuesday, November 24, 2009
  47. 47. Try your gem Tuesday, November 24, 2009
  48. 48. Report your problems! Tuesday, November 24, 2009
  49. 49. http://github.com/ evanphx/rubinius/ issues Tuesday, November 24, 2009
  50. 50. Performance Tuesday, November 24, 2009
  51. 51. Performance The Two Fronts Tuesday, November 24, 2009
  52. 52. Performance Why We Fight What We Write Tuesday, November 24, 2009
  53. 53. (0..10).to_a.each do |i| ary << i end Tuesday, November 24, 2009
  54. 54. 0.upto(10) do |i| ary << i end Tuesday, November 24, 2009
  55. 55. Performance The Two Fronts How We Run It Tuesday, November 24, 2009
  56. 56. Performance Benchmarking Tuesday, November 24, 2009
  57. 57. Performance Benchmarking Expectations vs. Reality Tuesday, November 24, 2009
  58. 58. Performance Benchmarking Lies, Damned Lies, and Statistics Tuesday, November 24, 2009
  59. 59. Benchmarks Tuesday, November 24, 2009
  60. 60. 114 Times faster than 1.8 100 86 71 57 43 29 14 0 ruby 1.9 jruby macruby rubinius Tuesday, November 24, 2009
  61. 61. 57 Times faster than 1.8 50 43 36 29 21 14 7 0 ruby 1.9 jruby macruby rubinius Tuesday, November 24, 2009
  62. 62. impl 1.8 1.9 jruby macruby rbx ms 309304 51113 113824 70580 24232 x faster 1.0 6.0 2.7 4.3 12.7 Tuesday, November 24, 2009
  63. 63. Benchmarks 12x faster! Tuesday, November 24, 2009
  64. 64. Benchmarks 12x faster! On these benchmarks! Tuesday, November 24, 2009
  65. 65. Benchmarks 12x faster! In general? Tuesday, November 24, 2009
  66. 66. Benchmarks What did we benchmark? Tuesday, November 24, 2009
  67. 67. Calling a method. Empty while loop. Creating a block. Accessing ivars. Performing ‘not’. Calling a polymorphic method. Calling super. Tuesday, November 24, 2009
  68. 68. Benchmarks Why these things? Tuesday, November 24, 2009
  69. 69. Benchmarks Why these things? How do these results translate? Tuesday, November 24, 2009
  70. 70. Analogy Tuesday, November 24, 2009
  71. 71. Dishonest? Tuesday, November 24, 2009
  72. 72. Rubinius Ruby performance begets core performance Tuesday, November 24, 2009
  73. 73. 1.8 Ruby performance begets ? Tuesday, November 24, 2009
  74. 74. Benchmarks Need more/better data Tuesday, November 24, 2009
  75. 75. def foo() ary = [] 100.times { |i| ary << i } end 300,000 times Tuesday, November 24, 2009
  76. 76. Seconds 8 7.82 6 4 4.24 3.91 3.26 2.60 2 0 1.8 1.9 macruby jruby rbx Tuesday, November 24, 2009
  77. 77. def foo() hsh = {} 100.times { |i| hsh[i] = 0 } end 100,000 times Tuesday, November 24, 2009
  78. 78. Seconds 11 10.5 8.25 7.62 5.5 4.77 4.7 2.75 1.67 0 1.8 1.9 macruby jruby rbx Tuesday, November 24, 2009
  79. 79. def foo() hsh = { 47 => true } 100.times { |i| hsh[i] } end 100,000 times Tuesday, November 24, 2009
  80. 80. Seconds 4 3.64 3 2.61 2.6 2 2.12 1.75 1 0 1.8 1.9 macruby jruby rbx Tuesday, November 24, 2009
  81. 81. Benchmarking Conclusion Tuesday, November 24, 2009
  82. 82. Benchmarking Conclusion Rubinius is awesome at ruby code Tuesday, November 24, 2009
  83. 83. Benchmarking Conclusion Comparing C/Java to Ruby Tuesday, November 24, 2009
  84. 84. More Ruby Tuesday, November 24, 2009
  85. 85. More Ruby Burden of our own devising Tuesday, November 24, 2009
  86. 86. More Ruby Fast compliance Tuesday, November 24, 2009
  87. 87. More Ruby Slower core performance Tuesday, November 24, 2009
  88. 88. More Ruby Slower core performance Ruby vs. C/Java Tuesday, November 24, 2009
  89. 89. More Ruby The upside... Tuesday, November 24, 2009
  90. 90. 114 Times faster than 1.8 100 86 71 57 43 29 14 0 ruby 1.9 jruby macruby rubinius Tuesday, November 24, 2009
  91. 91. 114 Times faster than 1.8 100 86 71 57 43 29 14 0 ruby 1.9 jruby macruby rubinius Tuesday, November 24, 2009
  92. 92. def m; nil; end def Bench.run i=0 while i < 15_000_000 i+=1 m; m; m; m; m; m; m; m end end Tuesday, November 24, 2009
  93. 93. impl 1.8 1.9 jruby macruby rbx ms 21361 6316 10101 3295 186 x faster 1.0 3.4 2.1 6.5 114.8 Tuesday, November 24, 2009
  94. 94. impl 1.8 1.9 jruby macruby rbx ms 21361 6316 10101 3295 186 x faster 1.0 3.4 2.1 6.5 114.8 Tuesday, November 24, 2009
  95. 95. impl 1.8 1.9 jruby macruby rbx ms 21361 6316 10101 3295 186 x faster 1.0 3.4 2.1 6.5 114.8 Tuesday, November 24, 2009
  96. 96. impl 1.8 1.9 jruby macruby rbx ms 21361 6316 10101 3295 186 x faster 1.0 3.4 2.1 114.8 6.5 Tuesday, November 24, 2009
  97. 97. impl 1.8 1.9 jruby macruby rbx ms 21361 6316 10101 3295 186 x faster 1.0 3.4 114.8 2.1 6.5 Tuesday, November 24, 2009
  98. 98. impl 1.8 1.9 jruby macruby rbx 114.8 ms 21361 6316 10101 3295 186 x faster 1.0 3.4 2.1 6.5 Tuesday, November 24, 2009
  99. 99. Bug Tuesday, November 24, 2009
  100. 100. Bug right? Tuesday, November 24, 2009
  101. 101. Bug Tuesday, November 24, 2009
  102. 102. def m; nil; end def Bench.run i=0 while i < 15_000_000 i+=1 m; m; m; m; m; m; m; m end end Tuesday, November 24, 2009
  103. 103. Year 4 JIT Method Inlining Tuesday, November 24, 2009
  104. 104. def m; nil; end def Bench.run i=0 while i < 15_000_000 i+=1 m; m; m; m; m; m; m; m end end Tuesday, November 24, 2009
  105. 105. bin/rbx -Xjit.inline.debug 0/bm_vm2_method.rb Tuesday, November 24, 2009
  106. 106. JIT: compiling Object#run inlining: primitive fixnum_lt into run. inlining: Object#m into run (<metaclass>) inlining: Object#m into run (<metaclass>) inlining: Object#m into run (<metaclass>) inlining: Object#m into run (<metaclass>) inlining: Object#m into run (<metaclass>) inlining: Object#m into run (<metaclass>) inlining: Object#m into run (<metaclass>) inlining: Object#m into run (<metaclass>) Tuesday, November 24, 2009
  107. 107. def m; nil; end def Bench.run i=0 while i < 15_000_000 i+=1 nil;nil;nil;nil;nil;nil;nil;nil end end Tuesday, November 24, 2009
  108. 108. def m; nil; end def Bench.run i=0 while i < 15_000_000 i+=1 end end Tuesday, November 24, 2009
  109. 109. Performance Tuesday, November 24, 2009
  110. 110. Performance Many programs, much faster Tuesday, November 24, 2009
  111. 111. Performance Many programs, a little slower Tuesday, November 24, 2009
  112. 112. Performance Some programs, a lot slower Tuesday, November 24, 2009
  113. 113. Releases Tuesday, November 24, 2009
  114. 114. Releases 0.13 Tuesday, November 24, 2009
  115. 115. Releases 0.13 JIT by default Tuesday, November 24, 2009
  116. 116. Releases 0.13 Lots of fixes Tuesday, November 24, 2009
  117. 117. 1.0rc1 Tuesday, November 24, 2009
  118. 118. Next Week! Tuesday, November 24, 2009
  119. 119. Expectations Tuesday, November 24, 2009
  120. 120. Expectations Runs rails 3 Tuesday, November 24, 2009
  121. 121. Expectations Performance improvements Tuesday, November 24, 2009
  122. 122. Expectations One RC every month Tuesday, November 24, 2009
  123. 123. Expectations One RC every month Until 1.0 is out. Tuesday, November 24, 2009

×