[R] flops calculation

jim holtman jholtman at gmail.com
Mon Oct 29 03:39:29 CET 2007


You would want to use the "user" time since that indicates that amount
of time it spends in the user application, which would be R.  Take a
look at the ratio between user and system;  user should be much higher
than system.  If not, then this might indicate that you have a lot of
I/O going on, or some other activity requiring the operating system
(e.g., memory allocation, paging, console updating, etc.).  Here is an
example of a CPU intensive operation and you can see that the system
time is zero:

> system.time(for (i in 1:1000) runif(1e4))
   user  system elapsed
   1.24    0.00    1.36
> system.time(for (i in 1:1000) runif(1e5))  # user time should be about 10X larger
   user  system elapsed
  14.72    0.00   14.83
>



On 10/28/07, kevinchang <shukai at seas.upenn.edu> wrote:
>
> Hi all,
>
> Since proc.time return three different kind of times (user, system and
> elapsed) , I am wondering which one is right for calculating flops. In New S
> Language (Becker et. al. ) , it seems to be the user because " the user time
> measures the processor time used in S  and the system time measures the
> operating system in response to S's request". But in R Help ,  system time
> sounds better as " The first two entries(referred to user and system time
> respectively) are the total user and system CPU times of the current R
> process and any child processes on which it has waited".  Please help .
> Thanks.
>
>
>
>
>
> --
> View this message in context: http://www.nabble.com/flops-calculation-tf4708965.html#a13459745
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at r-project.org 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.
>


-- 
Jim Holtman
Cincinnati, OH
+1 513 646 9390

What is the problem you are trying to solve?



More information about the R-help mailing list