10 Mar, 2013

3 commits

  • 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.
    Daniel Beardsley
     
  • Mongoid defines it's own ==() and eql?() methods that are based on the
    ObjectId. Comparable provides it's own ==() function that uses `<=>`
    under the hood.  == is used when inserting into a Hash, App docuemnts
    are put in hashes hundreds of times per request. We don't was to to call
    <=> hundreds of time.
    
    Putting the Comparable mixin at the top allows the mongoid mixin to
    override == with it's faster implementation.
    Daniel Beardsley
     
  • Keepin it DRY.
    Daniel Beardsley
     

08 Mar, 2013

8 commits


07 Mar, 2013

3 commits


06 Mar, 2013

9 commits


05 Mar, 2013

14 commits


04 Mar, 2013

1 commit


28 Feb, 2013

2 commits