newrelic/rpm — pull request #57 by jdelStrother (2012-03-15 12:21:13+00:00)
Title: Lazily load action-controller

Hi,
I've spent the past week or two trying to cut down on my Rails app's launch time, and have managed to improve 'rails runner 0' from 22s to 15s. Still not ideal, but it's an improvement...

A big part of the reason for the slowness is due to plugins referencing parts of Rails that don't necessarily need to be loaded, so, eg, ActiveRecord::Base gets pulled in even though I'm just trying to run 'rake routes'. As of Rails 3.0, this can be avoided using on_load hooks.

What do you think to the attached commit, which waits until ActionController::Base has been loaded before trying to inject instrumentation into it?