multitime icon indicating copy to clipboard operation
multitime copied to clipboard

Improve reporting of mean times + CI

Open snim2 opened this issue 10 years ago • 5 comments

Here is an example run of multitime:

===> multitime results
1: ./demosaic images/airplane_RGGB.png
             Mean                Std.Dev.    Min         Median      Max
real        1.563+/-0.3564      0.159       1.444       1.512       2.177       
user        1.408+/-0.0019      0.012       1.385       1.407       1.435    
sys         0.024+/-0.0012      0.009       0.012       0.024       0.052 

In this example, the wall clock time is not useful, but the amount of time spent on the CPU is of interest. Unfortunately, summing the user and sys rows is no longer valid, because confidence intervals are not additive.

Therefore, I propose a new list of rows to display on the output:

  • wall -- the wall clock time, currently named real (renamed for clarity)
  • cpu -- the real and sys rows added together with a correct confidence interval and standard deviation, etc.
  • user -- as it is now
  • sys -- as it is now

snim2 avatar Mar 18 '15 20:03 snim2

I'm open to seeing 'real' renamed to 'wall' (except in time compatibility mode when it must remain as 'real' for scripts that expect to scrape time's output).

However, I'm not sure that there's ever been a guarantee that real=user+sys, even in the traditional Unix time program? Perhaps because of that, I'm a bit nervous about suggesting that CPU time is just a factor of those two, because there might be other factors that contribute to CPU time that one simply can't get measurements for.

ltratt avatar Mar 18 '15 22:03 ltratt

Perhaps I have misunderstood time. I thought 'real' was the wall clock time, 'user' was the time spent on the CPU in user mode, and 'sys' was the time spent on the CPU in kernel mode.

So, in my proposed format 'wall' is the wall clock time, 'cpu' is 'user' + 'sys' which we would expect to be less than 'wall' (if the process has spent time waiting) or greater than 'wall' (if the process has parallel tasks in a multicore system).

It seems that adding 'user' and 'sys' is quite a common operation. Perhaps there is a better name for it than 'cpu', but that is how I have seen it referred to.

snim2 avatar Mar 18 '15 22:03 snim2

I pushed a first go at this to a branch called "cputime".

snim2 avatar Mar 18 '15 22:03 snim2

Do you want to make this a pull request?

ltratt avatar Apr 05 '15 15:04 ltratt

OK, done.

snim2 avatar Apr 06 '15 10:04 snim2