I'm on Rails 3.1.1, and I noticed that my application became extremely slow (15 seconds) in development mode. See my list of "Firebug Net" below:

I have done several things, such as:
- gem reduction
- turning class caching into
- switching asset debugging to false
- turning asset compression into true
- rail installation-dev-boost gem
There might have been some improvements, but nothing helped him go as fast as I expected when running localhost. That is, until I commented out the configuration line of my observers in application.rb :
config.active_record.observers = :item_observer, :loan_observer, :friendship_observer, :message_observer, :user_observer
And then the application was fast again (~ 1 s) boot time. See now the firebug list:

Other notes:
- When in production at Heroku, it is fast (~ 1 s), as you would expect.
- I use postgresql and thin; I have not tried using other databases to see if this problem exists.
- When I commented only on the last observer, user_observer, the load time was reduced by about half.
- The download time printed in
development.log does not reflect the actual download time. Assets were marked as 304 Not Modified (0ms), which really took a while to load. - Yes, I use the asset pipeline
Golden Question: Is it a simple act of registering observers that force assets to load slowly? And what can be done about this?
source share