[R] Quirks with system.time and simulations

Patrick Connolly p.connolly at hortresearch.co.nz
Mon Jun 14 03:57:34 CEST 2004

On Sun, 13-Jun-2004 at 08:50PM -0400, Roger D. Peng wrote:

|> I think the first time is potentially much slower because of a 
|> garbage collection.  

Even if I do gc() before each one, there's no difference, so I kind of
doubt that.

|> R-devel has a flag `gcFirst' for system.time() which (I think)
|> forces a garbage collection before timing.

Would that be any different from explicitly doing gc()?

I tried something similar in Splus 3.4.  Of course, the same code
doesn't work, but a large paste job took exactly the same time (to 4
decimal places) irrespective of how many times the job had been done
before.  Evidently, things are very different there.


Patrick Connolly
Mt Albert
New Zealand 
Ph: +64-9 815 4200 x 7188
I have the world`s largest collection of seashells. I keep it on all
the beaches of the world ... Perhaps you`ve seen it.  ---Steven Wright 

More information about the R-help mailing list