sdsykes / slim_scrooge

SlimScrooge heavily optimises your database interactions
313 stars 25 forks source link

Slows Down Tests #3

Closed adkron closed 14 years ago

adkron commented 14 years ago

There should be a config option to turn slim_scrooge off while in test mode. My integration tests took more that a minute longer with scrooge in place.

sdsykes commented 14 years ago

I don't see much of a slowdown myself, but we are using transactional fixtures. Anyway, it's always going to be slightly slower due to the extra work that slim_scrooge is doing to make a note of the queries as they go by - not much benefit is gained as most tests are executed once.

Rather than supplying an option for you, what about just doing

config.gem 'slim_scrooge' unless Rails.env.test?

in your environment.rb ?

adkron commented 14 years ago

I have a rather large project and multiple testing environments. It isn't bad to have to say unless blah && blah && blah, but I think it would be cleaner to have a configuration setting instead. Just my thought.

Also I have a rather large project and slim_scrooge added almost 2 minutes to the test run. With little to no benefit since most actions are hit only once or twice.

sdsykes commented 14 years ago

I accept your point - we could add some kind of config setting like: SlimScrooge.disable_in_test_env = true But for now I think for now I'll opt for simplicity - you can use my suggested method - but by all means fork and send me a patch.