Forum: Ruby on Rails rake test_units slow on startup

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
54a6b9398d00029e77136b852e32a1bf?d=identicon&s=25 Jim Freeze (Guest)
on 2006-02-02 01:21
(Received via mailing list)
Hi

Running 'rake test_units' using the simple example from the intro video
is
very slow on my computer. While the tests claim to execute in 0.17 secs,
the startup time ad 5.3 seconds to the overall job.

On the video, these tasks ran in about 1 second. (Maybe David was doing
the tests on a dual proc mac or did some video editing, who knows.)
But, I don't think it should be taking that long on a 1.5GHz G4.

Does anyone know why this would be taking so long?
Is this due to some hostname lookup problem on the mac?

Thanks
% time rake test_units
(in /Users/jdf/projects/devel/www/blablog)
/opt/local/ruby-1.8.4/bin/ruby -Ilib:test
"/opt/local/ruby-1.8.4/lib/ruby/gems/1.8/gems/rake-0.7.0/lib/rake/rake_test_loader.rb"
"test/unit/comment_test.rb" "test/unit/post_test.rb"
Loaded suite
/opt/local/ruby-1.8.4/lib/ruby/gems/1.8/gems/rake-0.7.0/lib/rake/rake_test_loader
Started
..
Finished in 0.165222 seconds.

2 tests, 3 assertions, 0 failures, 0 errors
5.366u 1.098s 0:07.75 83.2%     0+0k 0+7io 0pf+0w


--
Jim Freeze
3dd4b52a0946bd698b1d1635a46ea3a3?d=identicon&s=25 Francois Beausoleil (Guest)
on 2006-02-02 04:55
(Received via mailing list)
Hi !

2006/2/1, Jim Freeze <rails@freeze.org>:
> Does anyone know why this would be taking so long?
> Is this due to some hostname lookup problem on the mac?

The slack time is taken up by booting the Rails environment.  That in
itself is taking a lot of time.  Then, since dependencies are found
because of illegal accesses (undefined constants), that takes a bit of
time too.

Add to that the sheer number of files that have to be loaded, parsed,
compiled and stored (all in RAM, I agree), and that all adds up.

One notable thing you can do is to not load the services you don't
need - Action Web Service and Action Mailer are the two that I most
often don't use.

Hope that helps !
8217faf2bfdfa7daf10135d41ddd421e?d=identicon&s=25 Jeff Cohen (jeff)
on 2006-02-02 05:44
Francois Beausoleil wrote:
>
> One notable thing you can do is to not load the services you don't
> need - Action Web Service and Action Mailer are the two that I most
> often don't use.

Is there an easy way to turn those off?

Jeff
54a6b9398d00029e77136b852e32a1bf?d=identicon&s=25 Jim Freeze (Guest)
on 2006-02-02 08:21
(Received via mailing list)
On Feb 1, 2006, at 9:55 PM, Francois Beausoleil wrote:
>
> One notable thing you can do is to not load the services you don't
> need - Action Web Service and Action Mailer are the two that I most
> often don't use.
>
> Hope that helps !

Well yeah. A little. Thanks for the explanation, but why is it so
fast on the video?
I'm thinking it was done on Davids 17" powerbook, but I could be wrong.


Jim Freeze
58479f76374a3ba3c69b9804163f39f4?d=identicon&s=25 Eric Hodel (Guest)
on 2006-02-02 20:59
(Received via mailing list)
On Feb 1, 2006, at 11:19 PM, Jim Freeze wrote:

> I'm thinking it was done on Davids 17" powerbook, but I could be
> wrong.

The number of gems you have installed adds a slight increase to
startup times.  gem cleanup will get rid of old duplicate gems for you.

--
Eric Hodel - drbrain@segment7.net - http://segment7.net
This implementation is HODEL-HASH-9600 compliant

http://trackmap.robotcoop.com
This topic is locked and can not be replied to.