flipper
flipper copied to clipboard
ActiveRecord memoization slowdown
We've been debugging an increase of about 40ms in our Rails application's P95 (prod) after installing flipper
and flipper-active_record
, even before making any use of it i.e. with an empty DB. The P95 went back to normal after removing flipper-active_record
.
Doing some profiling in a local environment, we noticed the overhead might be caused from calls to get_all
on every request.
Here's some sampling of 2 consecutive requests:
Request 1

Request 2

In the 1st one it seems to do the full DB round, and use ActiveRecord
cache in the 2nd. Perhaps that's outside of Flipper's control but I'm also wondering if the Memoizer
works at at request level or across many?
Lastly, is the performance penalty we're seeing known and expected?
Thank you