gregbell/active_admin — pull request #2209 by Daxter (2013-05-17 04:18:44+00:00)
Title: improve test perf by deferring garbage collection

Our tests run noticeably faster by only running the garbage collector every 15 seconds.
Inspired by: www.ariejan.net/2011/09/24/rspec-speed-up-by-tweaking-ruby-garbage-collection

#### Rspec tests: 20 second, 40% improvement
```sh
time (DEFER_GC=false rspec spec 1>/dev/null)
real	0m52.368s
user	0m50.189s
sys	0m2.144s

time (rspec spec 1>/dev/null)
real	0m32.329s
user	0m29.206s
sys	0m3.087s
```
#### Cucumber tests: 35 second, 32% improvement
```sh
time (DEFER_GC=false cucumber features 1>/dev/null)
real	1m51.976s
user	1m40.672s
sys	0m9.517s

time (cucumber features 1>/dev/null)
real	1m16.127s
user	1m2.412s
sys	0m12.184s
```

#### When run together: 55 second, 32% improvement
```sh
time (DEFER_GC=false rake test 1>/dev/null)
real	2m55.147s
user	2m39.958s
sys	0m13.335s

time (rake test 1>/dev/null)
real	2m0.330s
user	1m42.163s
sys	0m16.593s
```