perf查看检测相关性能
2018-11-03 本文已影响0人
pandazhong
启动程序:./detectTest -p ./1080P -m ./eagle -t 30 -c 100000
perf stat统计结果如下:
![](https://img.haomeiwen.com/i14431436/2d111b13225636b5.png)
其他指标均正常,除了CPI,每周期执行了0.67条指令。
怀疑时CPU的IO导致,查看CPU缓存:
执行如下指令: perf stat -e instructions -e cache-references -e cache-misses -e L1-dcache-loads -e L1-dcache-load-misses -e L1-dcache-stores -e L1-dcache-store-misses -e LLC-loads -e LLC-load-misses -e LLC-prefetches -e cycles -e cs -p 36232
输出如下:
![](https://img.haomeiwen.com/i14431436/9e7ccf7bbf5a1e00.png)
从以上输出可知,L1D和LLC的misses偏高,为CPU IO密集型的计算。
多次测试结果表明,在Xone E5 2680型号的CPU上,每张图片检测大约需要0.7s左右。
![](https://img.haomeiwen.com/i14431436/61e540a6d8acb1a0.png)
附加:
在使用了taskset之后,性能有略微的提升.
numactl输出如下:
![](https://img.haomeiwen.com/i14431436/fabc248070a85502.png)
限制程序跑在0-35的线程:
![](https://img.haomeiwen.com/i14431436/3f10508bc65c03e1.png)
程序输出如下:
![](https://img.haomeiwen.com/i14431436/311885063c75e9c7.png)
平均检测时间比之前降低了10ms左右,看下perf的统计输出:
![](https://img.haomeiwen.com/i14431436/91739188e5db6d60.png)
每周期执行的指令数,L1D,LLC命中率都略微提升。