Saturday, January 3, 2015

Protip: Faster Ruby Tests with DatabaseCleaner and DatabaseRewinder

I use and love DatabaseCleaner, although historically I had never paid too much attention on the performance of its varies cleaning strategies - I’d always used truncation.
We use Postgres, and after digging around and finding out the difference between DELETE and TRUNCATE, I ended up improving our test suite speed by about 30-40% simply by tweaking the cleaning strategies.

No comments:

Post a Comment

Ruby Case Statements and `kind_of?`

You’re an object – Stand up straight and act like one! Imagine you have this code: Code 1: class MyView attr_reader :target ...