Slide 1

Slide 1 text

Garbage? Garbage? GARRRRRBAAAAAAGG GGEEEEEEE mrb / lightning talks @ pp / May 3, 2013

Slide 2

Slide 2 text

I Like Garbage

Slide 3

Slide 3 text

I Like Thinking About Garbage

Slide 4

Slide 4 text

I Like Thinking About Looking For Garbage

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

What is Garbage Collection?

Slide 7

Slide 7 text

Automatic memory management for your computer programs.

Slide 8

Slide 8 text

( )

Slide 9

Slide 9 text

No content

Slide 10

Slide 10 text

“Living” vs. “Dead”

Slide 11

Slide 11 text

What memory are you using, and what memory can be reclaimed?

Slide 12

Slide 12 text

Your objects form a graph.

Slide 13

Slide 13 text

Traversing graphs is hard.

Slide 14

Slide 14 text

The Big Algorithms • Mark and Sweep • Reference Counting • Generational

Slide 15

Slide 15 text

Ruby makes a lot of garbage.

Slide 16

Slide 16 text

Ruby’s Garbage Story https://bugs.ruby-lang.org/issues/8339 https://bugs.ruby-lang.org/attachments/3686/gc-strategy- en.pdf

Slide 17

Slide 17 text

Ruby’s Current GC • Mark And Sweep • Conservative • Bitmap Marking • Non-Recursive Marking • No Moving • Favors C Extensions

Slide 18

Slide 18 text

Rubyists wrote C extensions to make certain Ruby code run faster.

Slide 19

Slide 19 text

The primitive Garbage Collector supports these C extensions.

Slide 20

Slide 20 text

Now, this same Garbage Collector is what is preventing Ruby code from being as fast as it could be.

Slide 21

Slide 21 text

“Despite the best efforts of Koichi and other contributors, Ruby Core's concern with backwards compatibility (particularly regarding the C Extension API) keeps MRI lagging more than a decade behind Ruby implementations like Rubinius and JRuby which already have precise, generational and incremental garbage collectors.” - Vincent Marti (@vmg) https://github.com/blog/1489-hey-judy-don-t-make-it-bad

Slide 22

Slide 22 text

RGenGC Is... • An awesome, fearless hack • Likely to make some Ruby code run faster • Certain to not break compatibility with C extensions • Progress

Slide 23

Slide 23 text

RGenGC Isn’t... • The answer to Ruby’s problems • Likely to make all Ruby code faster in the long run • Going to draw people to Ruby • Limitless Progress

Slide 24

Slide 24 text

In Conclusion • We need to figure this out • We can find a way forward

Slide 25

Slide 25 text

Thanks!