Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what do "user","system", and "elapsed" times mean in R [duplicate]

I am adopting parallel computing in R, and doing some benchmark works. I notice that when multiple cores are used, system.time shows increased times for user and system, but the elapsed time is decreased. Does this indicate that parallel computing is effective? Thanks.

like image 849
alittleboy Avatar asked Mar 23 '23 12:03

alittleboy


1 Answers

If you do help(system.time) you get a hint to also look at help(proc.time). I quote from its help page:

Value:

 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 uses the ‘summary’ method to
 combine the child times with those of the main process.)

 The definition of ‘user’ and ‘system’ times is from your OS.
 Typically it is something like

 _The ‘user time’ is the CPU time charged for the execution of user
 instructions of the calling process.  The ‘system time’ is the CPU
 time charged for execution by the system on behalf of the calling
 process._

 Times of child processes are not available on Windows and will
 always be given as ‘NA’.

 The resolution of the times will be system-specific and on
 Unix-alikes times are rounded down to milliseconds.  On modern
 systems they will be that accurate, but on older systems they
 might be accurate to 1/100 or 1/60 sec.  They are typically
 available to 10ms on Windows.
like image 154
Dirk Eddelbuettel Avatar answered Apr 02 '23 19:04

Dirk Eddelbuettel