Linux C++: how to profile time wasted due to cache misses?

anon picture anon · Mar 21, 2010 · Viewed 30.1k times · Source

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.

Is there a way to measure the time my CPU wastes due to cache misses?

Answer

Taavi picture Taavi · Mar 21, 2010

You could try cachegrind and it's front-end kcachegrind.