N+1 Control: prevent the N+1 queries problem
NPlusOneControl (https://github.com/palkan/n_plus_one_control) is a new tool to prevent N+1 problems.
Unlike other libraries, n_plus_one_control is not a feature testing tool (i.e. you don’t have to specify exact expectations) but a performance testing tool – you test the performance of the code under consideration.
NPlusOneControl evaluates the code several times with different scale factors to make sure that the number of DB queries behaves as expected – O(1) instead of O(N).
That’s the way we make sure that no N+1 problem appears in our code.
Post a comment