Re: [R] efficient code. how to reduce running time?

From: Charilaos Skiadas <skiadas_at_hanover.edu>
Date: Mon 22 Jan 2007 - 17:08:03 GMT

On Jan 22, 2007, at 10:39 AM, John Fox wrote:

> One thing that seems particularly
> striking in your results is the large difference between elapsed
> time and
> user CPU time, making me wonder what else was going on when you ran
> these
> examples.

Yes, indeed there were a lot of other things going on, this is the only machine I have and I use it continuously. I'll try to run another test tonight when the machine is not in use. It did seem a very striking difference though.

But am I wrong in thinking that these measurements should be independent of what other applications are running at the same time, and should measure exactly the time in terms of CPU cycles needed to finish this task, regardless of how often the process got to use the CPU? I guess I was working under that assumption, which indeed makes the above comparison a very unfair one, because there was a lot more going on during the first system.time call.

Still, the difference is quite large, which of course could simply have to do with the internals of the two commands, coupled with Prof. Ripley's comments about malloc in Mac OS X.

> Regards,
> John

Haris



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Tue Jan 23 04:15:11 2007

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Mon 22 Jan 2007 - 17:30:33 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.