observers are so eager to load all the models, while other parts like 
associations/helpers/controllers always try to be lazy/avoid loading more 
then necessary

in our app: rails c loads 45 AR models,
with lazy_observers this can easily be reduced to 0 ( 
https://github.com/grosser/lazy_observers )

loadtime:
45 -> 14.2s
0 -> 12.0s

additional benefits would be:

   - faster + less memory
   - less database requests on boot -> faster + less likely to blow up when 
   in bad db state
   - gems can do their monkey-patching safely before models are loaded
   - environment can be forked before models are loaded -> simpler 
   spork-like workflow

would rails accept a pull request that integrates this ?

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/rubyonrails-core/-/k6vlaqTM0L0J.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-core?hl=en.

Reply via email to