So. You want faster rails tests so you can spend less time waiting for rake and more time sipping gatorpagne. I get it.
Add the following to your .bash_profile
. It's based off the 37 signals REE tuning.
# Ruby GC Tuning
export RUBY_HEAP_MIN_SLOTS=600000
export RUBY_GC_MALLOC_LIMIT=59000000
export RUBY_HEAP_FREE_MIN=100000
This step by itself improves performance quite a bit.
Follow Funny Falcon's guides to performance improvements.
Follow Jamis' Guide to faster tests for, scrub_instance_variables
. code.
- On a Mac I used
/usr/local/mysql/support-files/my-huge.cnf
as a base and setinnodb_buffer_pool_size=1G
, which was about 10x what it was before. - This change went from having tests take: 24 minutes, 39.146 seconds to 12 minutes, 41.172 seconds on our integration server.
Before: 37 minutes, 52.093 seconds
After: 12 minutes, 44.954 seconds
Savings: 25 minutes, 7.193 seconds,
66.335% faster overall on our CI environment