Speed up Rails, Speed up Your Code
summary
Benchmarks and profilers drive every decision: use benchmark-ips and ruby -d to measure iterations and hidden exceptions, sample with stackprof and inspect allocations with gc.stat and allocation_tracer, and trace calls via TracePoint. Finding: tag_options calls erb_utils.h create extra strings and an unnecessary SafeBuffer step; changing the escape path and freezing template literals cuts about 200 allocations per request and yields roughly 19% fewer objects vs 4.0-stable (14% vs 4.0.1). Rails 4.2 focuses on these concrete wins.
AI-written summary · about
chapters (28)
- 0:00Intro
- 1:20Development
- 1:34Jurassic Park!
- 2:53Cascadia Style Sheets
- 4:33Ruby Core Rails Core
- 6:43Ground Breaking Technology
- 7:06Markov Chains
- 9:01Picking Random Children
- 10:35Total trip cost
- 13:00Speed up Rails, Speed up your Code
- 14:35Find Swallowed Exceptions!
- 16:07Next Generation
- 17:37Performance Tools
- 18:17Raw Performance
- 21:57Blackbox Testing
- 24:34Does the length of the route impact "link_to"?
- 28:46Speeding up Helpers
- 28:57Profiling Request / Response
- 32:12String - String - String
- 33:25String Object Reduction
- 34:32Template Literals Can't Change
- 34:49Speeding up Output
- 35:11Law of Demeter
- 37:54Defensive Programming
- 38:04Limiting Types
- 39:00Eliminate Objects
- 39:20Report Performance Issues
- 40:21MEASURE!








