~/talk

Optimizing Ruby: Building an Always-On Production Profiler

Talkat RubyKaigi 2024 · 2024-05-15..05-17· [ruby]
slides:none on file

Datadog’s Ruby continuous profiler is an always-on production sampler that collects CPU, wall time, allocations, GC and heap-live objects with low overhead by sampling every 10 ms from a background C thread interrupting workers via Unix signals and RB_postponed_job_trigger. Implementation mixes C and Rust, shipping a C + Rust binary gem (Linux-first) that compresses pprof output. Real fixes include spotting a regex hotspot in a repo with 50,000 branches 130,000 tags and eliminating a duplicated ObjectSpace check that doubled cost.

AI-written summary · about

  1. 0:00Introduction to Ruby profiler
  2. 1:13Speaker background and Datadog
  3. 3:40Why build a new Ruby profiler
  4. 5:26Types of profiling data
  5. 10:20How CPU and wall time work
  6. 12:49Sampling for low overhead
  7. 13:31CPU and wall time details
  8. 16:39Handling the GIL in Ruby
  9. 17:42Adjusting sampling overhead
  10. 18:03Garbage collection profiling
  11. 19:27Tracking object allocations
  12. 20:32Detecting memory leaks
  13. 21:59Challenges in profiling
  14. 24:50Using Rust in Ruby gems
  15. 26:58Why always-on production profiling
  16. 29:47Learning from profiling data
~/search
type to search 8,222 conferences, 162,397 speakers and 219,688 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
← →
on a talk: 5 seconds back / forward
0–9
on a talk: jump to 0%–90% of the recording
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.