How to Performance
summary
A reproducible test app and a Benchmark IPS harness establish a baseline, then profiling with RubyProf and sampling with StackProf (switching CPU→wall time) plus Ruby VM stats and AllocationTracer finds real culprits: an unnecessary URL_helpers include that busts the method cache, hot delegate code, and heavy string allocations. Iterations move from ~393 to ~828, integration tests go from ~2.53× slower to about 1.2× slower versus controller tests, and targeted fixes (move include, memoize, freeze strings) produce most of the gains.
AI-written summary · about
chapters (11)
- 0:00Introduction
- 2:22Benchmarking vs Profiling
- 4:43Building a Baseline
- 9:52Benchmarking
- 11:08Profilers
- 14:32Ruby prof
- 15:21Stock prof
- 18:41Walltime
- 20:21Method Cash
- 22:45Method Cash 2
- 27:07String Allocation








