[Rubygems-developers] Gem::Specification#copy_of and Rails makes
tests startup slow
Eric Hodel
drbrain at segment7.net
Tue Dec 7 12:26:02 EST 2004
Bump
On 01 Dec 2004, at 22:13, Eric Hodel wrote:
> I have a small testcase in rails that has 7 tests in it (4 of them
> raise NotImplementedError), but simply starting up the testcase takes
> 3 seconds:
>
> $ ruby -r profile -Ilib:test test/unit/emailer_test.rb
> % cumulative self self total
> time seconds seconds calls ms/call ms/call name
> 18.37 5.57 5.57 462 12.06 19.42 Integer#gcd
> 10.26 8.68 3.11 4008 0.78 2.37
> Gem::Specification#copy_of
>
> The tests themselves complete in less time than it takes to perform
> all the copying:
>
> $ ruby -Ilib:test test/unit/emailer_test.rb | unit_diff
> Loaded suite test/unit/emailer_test
> Started
> ..E.EEE
> Finished in 2.526909 seconds.
> [...]
> 7 tests, 18 assertions, 0 failures, 4 errors
>
> When running the entire test suite this startup cost is minimal
> compared to the run time of the tests, but it rarely makes sense to
> run the entire test suite at once. Is all the copying done in
> #copy_of completely necessary?
>
> BTW: These were run on a PowerBook G4 1.5GHz
More information about the Rubygems-developers
mailing list