Tracing your way through Ruby
summary
When Ruby slows or segfaults the answer is tracing actual events not higher‑level concepts: use perftools.rb, dtrace and instruments to attach to the VM, enable the probes branch that exposes function entry/gc/object/raise probes, aggregate events to find hotspots (one example shows 4883 calls to a single method), histogram GC pauses (most ~0.2s), use dtruss/iosnoop for syscalls, JVM probes for JRuby, and note some illegal‑instruction bugs only disappear after upgrading Ruby — the probes otherwise work.
AI-written summary · about
chapters (11)
- 0:00Intro
- 2:35What is Dtrace
- 4:31Probes
- 6:10Dtrace
- 8:12Dtrace probes
- 9:37Printf
- 11:10Attach to process
- 11:47Local variables
- 14:35Aggregate functions
- 16:27Other tools
- 21:55JRuby








