palkan / n_plus_one_control

RSpec and Minitest matchers to prevent N+1 queries problem
MIT License
553 stars 20 forks source link

Add warmup feature #14

Closed Earendil95 closed 6 years ago

Earendil95 commented 6 years ago

If you use caching in your models (e.g. IdentityCache), you can face with this:

       Expected to make the same number of queries, but got:
         21 for N=2
         13 for N=3
         13 for N=4

It is not N+1 but spec failed.

So I've added warmup method to DSL that called before we start measure queries.