Unfortunately, an in-memory database is both dangerous and doesn't fix the
problem. Factory_girl spits out 50-100 lines of sql junk in the RSpec log
PER test. I tried switching to sqlite3 using the ":memory:" option, and it
only saved me about 15-20%. That's not much of an improvement.

By getting rid of Factory Girl entirely, I have increased my test
performance by 2000%.

Ken


On Wed, May 25, 2011 at 5:53 PM, Sidu Ponnappa <ckponna...@gmail.com> wrote:

> Given the limitation Justin just mentioned, an easy performance win is
> to switch your testing environment to use an in-memory db. You could
> also parallelize your specs to use all cores on your machine.
>
> Best,
> Sidu.
> http://c42.in
> http://about.me/ponnappa
>
> On 26 May 2011 00:30, Ken Egervari <ken.egerv...@gmail.com> wrote:
> > I am using factory_girl, and I have discovered that it is chiefly
> > responsible for making my tests run slow.
> >
> > I have posted a question about this on Stack Overflow:
> >
> >
> http://stackoverflow.com/questions/6128476/how-can-i-get-factory-girl-to-never-hit-the-database-if-i-am-calling-factory-buil
> >
> > Anyway, I was curious what you guys use to create Factories?
> >
> > 1. Do you put up with Factory_girl?
> > 2. Did you configure Factory_girl differently to make it run faster?
> > 3. Do you use something else? May I ask what?
> >
> > Thanks!
> >
> > Ken
> >
> > _______________________________________________
> > rspec-users mailing list
> > rspec-users@rubyforge.org
> > http://rubyforge.org/mailman/listinfo/rspec-users
> >
> _______________________________________________
> rspec-users mailing list
> rspec-users@rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>
_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to