O'Reilly logo

Ruby Performance Optimization by Alexander Dymo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 10Tune Up the Garbage Collector

Many of the optimizations so far in this book involved avoiding or postponing GC as much as possible. But we can only do so much by working around the GC’s inefficiency. Let’s instead look into the face of evil. Ruby GC is, in fact, not a black box. We can understand it. And with modern Ruby interpreters, we can control it. This means that we can tune up GC for optimal performance in our applications.

That is, of course, only possible if we know enough about Ruby and GC internals. So let’s first figure out how they work, and then talk about tuning the GC settings.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required