Dear R-users, I run my program a difference between sys.times is as follows: user system elapsed 60167.53 2848.75 63278.93 I am quite puzzled how it may happen that system time is so much shorter than user time, I have 2 core computer most of the time (90%) I was not doing anything else with the computer. What could be the reason of such a difference? I switched off file indexing and all other resident programs...... My program include writing output into a file - could that be the reason? Thanks for your replies. -- -------------------------------------------------------------------------------------------- Jiøí Voller Laboratory of Growth Regulators Palacký University & Institute of Experimental Botany AS CR ©lechtitelù 11, 783 71 Olomouc Czech Republic http://rustreg.upol.cz landline: +420-585-634-855 cell: +420-737-520-506 fax: +420-585-634-870 ---------------------------------------------------------------------------------------------- [[alternative HTML version deleted]]
Prof Brian Ripley
2008-Apr-26 14:26 UTC
[R] sys.time question - how to improve R performance
On Sat, 26 Apr 2008, Ji?? Voller wrote:> Dear R-users, > I run my program a difference between sys.times is as follows: > user system elapsed > 60167.53 2848.75 63278.93 > > I am quite puzzled how it may happen that system time is so much shorter > than user time, I have 2 core computer most of the time (90%) I was not > doing anything else with the computer. What could be the reason of such a > difference? I switched off file indexing and all other resident > programs...... My program include writing output into a file - could that be > the reason?First, do you mean system.time()? Its help page refers you to ?proc.time, which says: An object of class '"proc_time"' which is a numeric vector of length 5, containing the user, system, and total elapsed times for the currently running R process, and the cumulative sum of user and system times of any child processes spawned by it on which it has waited. (The 'print' method combines the child times with those of the main process.) and it seems you don't know those terms. At any given time a CPU is running a task for a process, it is either in a system call or in user code (R itself or a package). This is recorded every once in a while (a few ms) and totalled. So your process spent 2848s in system calls. The elapsed time is a little more than the sum of the user and system times, as your R session was not running 100% of the time. You didn't even tell us your OS (see the posting guide) nor your background . On a Unix-alike look at the man pages for time and times. E.g. mine says The tms_utime field contains the CPU time spent executing instructions of the calling process. The tms_stime field contains the CPU time spent in the system while executing tasks on behalf of the calling process.> > Thanks for your replies. > > -- > -------------------------------------------------------------------------------------------- > Ji?? Voller > Laboratory of Growth Regulators > Palack? University & Institute of Experimental Botany AS CR > ?lechtitel? 11, 783 71 Olomouc > Czech Republic > http://rustreg.upol.cz > landline: +420-585-634-855 > cell: +420-737-520-506 > fax: +420-585-634-870 > ---------------------------------------------------------------------------------------------- > > [[alternative HTML version deleted]]-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
Apparently Analagous Threads
- Exporting of R dendrogram object in the format of Eisen´s Cluster
- Constructin a call of function including permutation of column names - how to escape parentheses?
- passing arguments to a function problem
- Trying to write Merge for more data.frames - Error in match.names(clabs, names(xi))
- Problem with Win 7 and Samba 3.3.10 PDC (Trust Relationship Between Workstation and Domain Failed)