[rspec-users] Rspec Rails high overhead

Matt Wynne matt at mattwynne.net
Tue Jan 6 08:52:31 EST 2009


On 6 Jan 2009, at 13:02, aslak hellesoy wrote:

>
>
> On Tue, Jan 6, 2009 at 4:29 AM, Reza Primardiansyah <reza.primardiansyah at gmail.com 
> > wrote:
> Aslak,
> The best time I get is 6.3 seconds. I'm using "time script/server"  
> command and hitting Ctrl-C immediately after I see "** Use CTRL-C to  
> stop."
>
> Ok, so you have 5 seconds of additional overhead. I'm guessing that  
> RSpec takes maybe 0.5-1 seconds of the remaining 6 seconds overhead,  
> and that plugins, gems and other code the rest. Maybe you'll find  
> out more with http://ruby-prof.rubyforge.org/
>
> Aslak

Worth mentioning that I went down a huge rabbit hole with a similar  
problem (slow load of rails environment) a few weeks ago, and it  
turned out that all I needed was a reboot. (Mac OSX Leopard). Boy, did  
I feel like a chump!


>
>
>
>
>
> On Sun, Jan 4, 2009 at 9:43 PM, aslak hellesoy <aslak.hellesoy at gmail.com 
> > wrote:
>
>
> On Sun, Jan 4, 2009 at 3:58 AM, Reza Primardiansyah <reza.primardiansyah at gmail.com 
> > wrote:
> Greetings,
> 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. That means almost 11s overhead.
> I can't find the bottleneck. I use latest rspec, and rails 2.2 on  
> Debian.
>
> $ time rake spec
> (in /home/reza/system)
> ....................................................................................................................................................................................................................................................................................................................................................
>
> Finished in 5.493595 seconds
>
> 340 examples, 0 failures
>
> real    0m16.497s
> user    0m14.059s
> sys     0m2.266s
>
> I know that Debian's ruby is slow. So I tried using enterprise ruby.  
> Not much difference
>
> $ time /opt/ruby-enterprise/bin/ruby /var/lib/gems/1.8/bin/rake spec
> (in /home/reza/system)
> ....................................................................................................................................................................................................................................................................................................................................................
>
> Finished in 3.170093 seconds
>
> 340 examples, 0 failures
>
> real    0m12.033s
> user    0m9.948s
> sys     0m1.735s
>
> The overhead is also felt when using autospec. Even using sqlite's  
> in-memory-db doesn't change much.
>
> Can anyone give me hint about what happens and what to do to  
> overcome it?
>
> How long does ruby script/server take before the server is up?
>
> Aslak
>
>
> Thanks all.
>
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>
>
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>
>
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users

Matt Wynne
http://blog.mattwynne.net
http://www.songkick.com



More information about the rspec-users mailing list