Like the ancient civilizations uncovered by anthropologists, the tools we use say something about who we are. Chris joyfully uses Ruby every day. He believes that flourishing is the key to happiness, servers are an anachronism, and the person that will create SkyNet has already been born. At New Relic he is a Happiness Engineer, where they let him work on things that makes someone’s day better. His stuff lives in San Francisco where he visits it from time to time. Chris tweets occasionally, speaks often, and drinks coffee in between.
Garbage collection is one of the pillars of Ruby's performance story, but getting into the inner workings of MRI's garbage collector is a bit hairy. If you want to explore the garbage collector then you're going to have to get your hands deep into C code.
We're going to take a walk through the C internals from Foo.new through garbage collection in Ruby's MRI. We’ll examine the idioms and optimizations in the C source and leave you feeling comfortable to explore the code yourself.
At the end of the rb_newobj() rabbit hole is a whole world of garbage collection. Major changes have been made in MRI's garbage collector from Ruby 1.8 through 2.0: changes intended to make Ruby more performant, changes that can capitalize on MRI's roots in UNIX. From mark-and-sweep to copy-on-write and bitmap marking, we'll see what the future of Ruby performance might look like by peering through the window of the garbage collector.
I wish I could vote for this more than once!
Jan's suggestion was what I was thinking as well.
This looks really promising :-)
It would be great to see a short overview of approaches to garbage collection in other Ruby implementations and a comparison with MRI's GC, if time allows.