我使用了perf stat --repeat 100 -e cache-references,cache- misses,cycles,instructions,branches,faults,migrations ./avx2ADD
命令,输出是跟随的。当缓存未命中百分比等于 4.010 %
时,cache-misses
的+- 8.93%
是什么意思?
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% )
手册页中描述了+- 8.93%
部分:
-r, --repeat=
重复命令并打印平均值 + stddev(最大值:100)。 0 表示永远。
如果您不确定 stddev
的缩写是什么意思,它是标准偏差(是的,也可能有更详细的手册页)。简而言之,结果与所有重复测量的差异有多大。值越小越好,但是如果你有这么小的问题(500k条指令),偏差会更大,因为缓存未命中可能是不确定的。
然后,4.010 %
的百分比表示上述描述中的平均值。