[rspec-users] Rspec Rails high overhead

Nick Hoffman nick at deadorange.com
Sun Jan 4 09:57:47 EST 2009

On 2009-01-03, at 23:17, Mark Wilden wrote:
>> On Sat, Jan 3, 2009 at 6:58 PM, Reza Primardiansyah <reza.primardiansyah at gmail.com 
>> > wrote:
>> I found out that running RSpec on Rails takes too much overhead. It  
>> takes more than 16s per run although the specs only take less than  
>> 6s, like seen below.
> The killer is the time it takes to load environment.rb, which loads  
> Rails, runs initializers, etc. The rake spec task also tears down  
> and recreates the test database, but that's not as significant.
> The solution to the first situation is spec_server, which loads the  
> environment once, then stays in memory as a DRb process. By passing  
> --drb to the spec command, RSpec will have that process run specs.  
> The solution to the second situation is to not run rake spec, but  
> instead use spec or autospec.
> All that said, I haven't had as much joy from spec_server as I have  
> in the past. Too often it seems to not load changed models. But this  
> might be related to a patch I had to apply to even get it to run.  
> Things seemed to have changed with Rails 2.2.2 and/or RSpec 1.1.11.
> ///ark

Mark, would you mind explicitly telling us/me how you get the ``spec''  
command to run within DRb, please?

This is what happens I try [and fail] to do so:


More information about the rspec-users mailing list