Commit f438aef9aae1e8ff08de1458406a03c6f899f018
1 parent
14f93809
Exists in
master
and in
1 other branch
Drastically speed up Errbit
Enable the identity map for Mongoid. This allows subsequent finds for the same object to skip the DB and use an in-memory store of all retrieved records. In many cases this reduces the number of DB queries from _hundreds_ to a few tens. This is particularly noticable when showing lists of problems. Previously each `problem.app` reference caused a Apo.find() using the `app_id`, now it's an in-memory lookup.
Showing
4 changed files
with
7 additions
and
0 deletions
Show diff stats
config/application.rb
... | ... | @@ -48,6 +48,9 @@ module Errbit |
48 | 48 | g.fixture_replacement :fabrication |
49 | 49 | end |
50 | 50 | |
51 | + # Enable the mongoid identity map for performance | |
52 | + Mongoid.identity_map_enabled = true | |
53 | + | |
51 | 54 | # IssueTracker subclasses use inheritance, so preloading models provides querying consistency in dev mode. |
52 | 55 | config.mongoid.preload_models = true |
53 | 56 | ... | ... |
config/mongoid.example.yml
config/mongoid.mongohq.yml
config/mongoid.mongolab.yml