I have a Rails application where I added the friendly_id with the history module enabled and performance during tests plummeted. I’m talking about going from 15 minutes to 30 minutes in the absolutely best runs, and sometimes it goes into the multi-hour mark (not sure how long, it was too long for me to wait).
My tests create a lot of records (long story for another day). There’s one particular query related to the history module as far as I can tell that sometimes takes as long as 1 to 2 seconds to run. I’m not 100% sure why yet, but the reality is that I don’t need the friendly_id slug generation for most tests and I don’t need the history tracking except for one single test.
Is it possible to temporarily turn off friendly_id slug generation? or is it possible to turn the history module off?
The relevant code is here: https://github.com/pupeno/repeater_world/blob/b83ea68f3bbd4a12c63d726983b70f125e9b6e11/app/models/repeater.rb#L105-L106 (it’s all open source):
include FriendlyId
friendly_id :generate_slug, use: [:slugged, :history]