ActionDispatch::Routing::RouteSet#clear iterates over the _path_helpers and _url_helpers modules and calls undef_method for every generated helper, then rebuilds them when routes are reloaded. Because those modules are (indirectly) included in every controller in the application, the cost scales with the number of controllers. In the talk, this method dominated the flame graph and grew with each reload because controllers were accumulating.