cache-crispies
cache-crispies copied to clipboard
Add support for preloading related data for missing collection entries
Hi,
This PR adds a preloads
method to add a hook so we can preload relations in collections so that we can avoid n+1 issues
Thanks @Nerian. I pushed up some changes to address a failing spec. It looks like it caused some merge conflicts. Sorry about that.
About the PR, I like the idea of this. However, I'm a bit concerned that it could have a negative impact on performance since there is so much logic being added, especially in the case where there is a cache hit. Would you be willing to do some performance comparisons, with and without this change?
We have been using this for a few months in production and it has worked fine. But I added more changes in some other branch so maybe I will rebase this branch with all these changes and submit again.
I like the idea of measuring performance difference between versions of cache-crispies. Is there a rake task I can use for that, or should I write one? Should I perhaps use this? https://github.com/codenoble/cache-crispies-performance-comparison