3 ms·
We used factory girl to alleviate some of this on the rails project I participated in. It helped but we still had a problem every time a new required field was
by hinkley 11y ago
We used factory girl to alleviate some of this on the rails project I participated in. It helped but we still had a problem every time a new required field was added to the data model. In practice because of the issue of fixing all the existing tests, the cost of adding a new field went up logarithmically.
Honestly if you can't eliminate the persistence layer, I'd rather see DB vendors put more time and effort into making in memory tables work. The Java people (hibernate) swap out the store for an in-memory one to speed things up, but I'd rather see a Postgres instance with heavy write-back caching for testing.
- MichaelGG 11y agoPut the data files on a RAM disk?
- grandalf 11y agoIn the code I've reviewed, it's not the speed of the db (mysql vs sqlite in-memory, for example), it's the overhead of ActiveRecord itself... tons of ruby object creation, GC, etc...
- hinkley 11y agoI think we were down to about 80ms per test on that one. I've since had projects with 9ms per test and it's hard to go back to thinking 80ms is 'good'.