Profiling to make your Rails app faster
summary
Uses rack-mini-profiler to find that checkouts slow because payment capture and email hit remote services and moving those to ActiveJob makes requests fast; caching product partials drops product index from ~600ms to ~40ms (~15x); boot time regresses by ~4s due to shipping rates initializer, moving it to a rake task and streaming the download halves memory allocations; fixes an N+1 on cart items with includes and verifies ~10x win with benchmark/ips.
AI-written summary · about
chapters (13)
- 0:00Start
- 4:46Upgrade Ruby
- 7:04Database profiling
- 7:53Memory profiling
- 10:12Call-stack profiling
- 16:41Controller
- 21:37Development vs Production vs Test
- 29:56Code loading
- 34:56Production profiling
- 39:39Rack Mini Profiler
- 39:56Use Caching
- 40:13Memory profile complex methods
- 40:34Benchmarking
related talks
45mRails Performance Monitoring 101: A Primer for Junior Developers
26mRails Performance Monitoring 101: A Primer for Developers
41mSpeed up Rails, Speed up Your Code
01h 02mPerformance
30mDevelopment Speed Optimizations in Rails 8
29mHow to Performance
01h 15mSpeedupRails, Speedup Your Code
42m3x Rails: Tuning the Framework Internals
