Much faster Rails tests if you use MyISAM

Here’s a little insight I had the other day.If you use MyISAM tables, and there are various performance related reasons you might, then you’ve been stuck having to turn transactional fixtures off in your tests.But unless you are using some special feature of MyISAM that is not present in InnoDB, then why not use InnoDB tables in your test database?I wrote a simple plugin that has a rake task that clones the development database to the test while changing the ENGINE to InnoDB.You just run the task, turn transational fixtures on in test/test_helper.rb, and you’re off.Result: our tests used to take 8.5 minutes to run. Now they take just 3 minutes. That’s about 65% less time than it used to take.The plugin is here: http://github.com/sdsykes/fast_fixture

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s