Search code examples
cachingperf

What does +-# after percent of cache misses mean in perf stat?


I used perf stat --repeat 100 -e cache-references,cache- misses,cycles,instructions,branches,faults,migrations ./avx2ADD command and the output is followed. What does +- 8.93% for cache-misses mean when percent of cache misses is equal to 4.010 %?

 32,425      cache-references                                       ( +-  0.54% )
  1,300      cache-misses         #    4.010 % of all cache refs    ( +-  8.93% )
538,839      cycles                                                 ( +-  0.28% )
520,056      instructions         #    0.97  insns per cycle        ( +-  0.22% )
 98,720      branches                                               ( +-  0.20% )
     95      faults                                                 ( +-  0.12% )
      0      migrations                                             ( +- 70.35% )

Solution

  • The +- 8.93% part is described in manual page:

    -r, --repeat=

    repeat command and print average + stddev (max: 100). 0 means forever.

    If you are not sure what is meant be abbreviation of stddev, it it Standard Deviation (yes, also there could be manual page more verbose). In short, how much the results differ from all the repeated measurements. Less value is better, but if you have such a small problem (500k instructions), deviation will be larger, because cache-misses might be non-deterministic.

    The percentage 4.010 % then means the average from the description above.