Linux C ++:如何分析由于缓存未命中而浪费的时间? [英] Linux C++: how to profile time wasted due to cache misses?
本文介绍了Linux C ++:如何分析由于缓存未命中而浪费的时间?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我知道我可以使用gprof对我的代码进行基准测试.
I know that I can use gprof to benchmark my code.
但是,我遇到了这个问题-我有一个智能指针,它具有额外的间接级别(可以将其视为代理对象).
However, I have this problem -- I have a smart pointer that has an extra level of indirection (think of it as a proxy object).
结果,我有了这个额外的层,几乎可以实现所有功能,并具有缓存功能.
As a result, I have this extra layer that effects pretty much all functions, and screws with caching.
有没有一种方法可以测量由于高速缓存未命中而导致CPU浪费的时间?
Is there a way to measure the time my CPU wastes due to cache misses?
谢谢!
推荐答案
您可以尝试 cachegrind 这是前端kcachegrind.
You could try cachegrind and it's front-end kcachegrind.
这篇关于Linux C ++:如何分析由于缓存未命中而浪费的时间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文