Tool belt of a seasoned bug hunter
summary
Tests that used to start quickly begin taking 20–30 seconds after a series of commits; git bisect plus an automated script narrows the window but fails until dependency and DB problems are handled. Heap dumps via ObjectSpace.dump_all and analysis with hippy show many class/DSL objects; CPU sampling and flamegraph diffs reveal Rails spending tons of time undefining methods (clearing method caches). Root cause: an internal monolith eagerly generates anonymous controllers for routes. Making controller generation lazy fixes startup slowness.
AI-written summary · about
chapters (22)
- 0:00Start
- 6:16A Tool Belt of a Seasoned Bug Hunter
- 7:13Baaaad bugs Not so bad bugs
- 7:42Silent bugs
- 8:042016: a debugging odyssey
- 8:45Reproduce
- 10:07What introduced it?
- 12:24Install gems
- 12:52Reset the database
- 13:12Missing dependency
- 14:36Monolith: Business Action Framework
- 18:05$ gem install heapy
- 19:02Class DSL objects survive longest
- 19:27Let's trace a call stack
- 21:38$ gem install flamegraph
- 26:21Is removing a method from a module slow?
- 27:24Dig into Ruby!
- 28:12Is adding a method to a module slow?
- 28:59Complete the puzzle
- 29:59We're leaking controllers
- 30:35Fixing it!
- 31:29The Lesson








