[R] Re: Simple Lookup... why so slow

Thomas Lumley tlumley at u.washington.edu
Fri Aug 6 16:46:45 CEST 2004


On Fri, 6 Aug 2004, Dieter Menne wrote:

>
> Ok, found it out. Things are really speedy when you first store result in a
> vector, and cbind the vector to the data frame later.
>
> Assuming that copying is involved, this would explain to me that my first
> approach was so much slower, but I don't understand why time goes up more
> than linearily with n.
>

The garbage collection overhead and then the overhead of paging to disk
will often make the time nonlinear for problems that use a lot of memory.

	-thomas




More information about the R-help mailing list