assaf/vanity — pull request #214 by phillbaker (2014-06-13 02:14:21+00:00)
Title: Lazy-load Rails frameworks

* Avoid loading ActionController/ActionMailer::Base until they're needed
* Avoid loading ActiveRecord::Base until it's needed

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 when just trying to run 'rake routes'. As of Rails 3.0, this can be avoided using on_load hooks.