The depths of profiling Ruby
summary
Announces a new profiler called pf2 profiler that samples Ruby and C stacks, records per-kernel-thread CPU time via timer_create/SIGPROF, and matches libtrace-collected PC values to Ruby threads; uses rb_profile_thread_frames, TracePoint and thread events for GC/GVL state, unwinds C stacks with libbacktrace/DWARF after the run, and visualizes with the Firefox profiler. Implementation is in Rust, aims for <5% overhead with a 19 ms default sampling rate, and adds FE-extension visibility (example: MyQ2) so hidden C-level hotspots become visible.
AI-written summary · about
chapters (12)
- 0:00Introduction and motivation
- 1:37What is a profiler
- 3:00Introducing pf2 profiler
- 8:25Profiler mission and design
- 10:55Collecting Ruby stack samples
- 14:54Profiling C extensions
- 15:37Sampling scheduling strategies
- 18:28Controlling overhead
- 20:36Unwinding and aggregation
- 23:47Visualization and tools
- 24:53Future of Ruby profiling
- 26:41Acknowledgements and Q&A
related talks
26mHow a Ruby profiler works: Stackprof under a microscope
37mThe Future of Ruby Performance Tooling
24mDIY::Thread.profile -- Light-Weight Profiling in Pure Ruby
29mext/profile, or How to Make Profilers Tell the Truth
42mDebugging Ruby
43mReal World Ruby Performance at Scale
28mTracing your way through Ruby
29mChasing Real-Time Observability for CRuby
