Lourens Naudé announces his topic for #Rubyc15

Lourens Naudé gave a detailed description of his topic for upcoming #RubyC15! Read on and let us know what you think.

Abstract

Let's be honest. The Ruby Garbage Collector is a performance and memory hog. Not all is lost, however. The GC has seen several profound improvements in the latest Ruby 2.X versions. These changes also spawned new optimisation opportunities.

MRI Ruby maintainer Koichi Sasada has said: “Try GC parameters. There is no silver bullet. No one answer for all applications. You should not believe other applications settings easily Try and try and try!”

Tuning GC by hand is black magic at best. We'll look at GC patterns in Rails, how your app is affected and how to tune GC automagically.

Details

Even a single Rails app can produce a completely different object graph depending on the context in which it is used – from request/response cycle to rake tasks to tests. In fact, every single line of code executed has the potential to mutate the object graph.

These "application roles" directly affect garbage collection and thus app performance and memory usage.

In this talk we'll cover:

  • A 35k feet view of what mutation is and the interplay between the virtual machine executing code and the Garbage Collector.
  • Common "units of work" (read: where mutation occurs) in Rails apps, like the request/response cycle, handling async jobs, booting the app etc.
  • Very quick overview of what you can tune for.
  • A high level strategy for approaching and applying this to units of work.
  • A solution for doing all of this automatically.
  • Some notes on application development workflow and how it changes the Ruby heap over time - any tuning needs to be systematic and repeatable.