Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the best way to detect CPU cache misses when running an algorithm?

We have an algorithm which is performing poorly and we believe it's because of CPU cache misses. Nevertheless, we can't prove it because we don't have any way of detecting them. Is there any way to tell how many CPU cache misses an algorithm produces? We can port it to any language which could allow us to detect them.

Thanks in advance.

like image 882
rreyes1979 Avatar asked Nov 05 '22 08:11

rreyes1979


1 Answers

Easiest way to find out such kind of issues is to use profilers and collect cache related performance counters.

I would recommend to check following tools:

  • Intel® VTune™ Amplifier XE (supports: linux and windows; C/C++, Java, .NET) - http://software.intel.com/en-us/articles/intel-vtune-amplifier-xe/
  • OProfile - http://oprofile.sourceforge.net/

Is it possible to see the overall structure of your algorithm (if it is not too long)?

like image 169
Elalfer Avatar answered Nov 10 '22 16:11

Elalfer