Don't load stuff you don't need
Posted 28 Nov 2005
Using Rails 0.14 and onward, you can give your app a slight performance boost by not loading parts of the framework that you don't need. For example, if you don't expose parts of your app as a web service, then you don't need to load actionwebservice. Likewise, if you don't send mail from your app, you don't need to load actionmailer. If you're using the Rails initializer to start your app, you can do it like so:Rails::Initializer.run do |config|
# Skip frameworks you're not going to use
config.frameworks -= [ :action_web_service, :action_mailer ]
...
end
# Require Rails libraries.
require 'active_support'
require 'active_record'
require 'action_controller'
# require 'action_mailer'
# require 'action_web_service'
RAILS_CONNECTION_ADAPTERS = %w(mysql)