c++profilingperfintel-vtunecallgrind

How to profile time spent in memory access in C/C++ applications?


Total Time spent by a function in an application can be broadly divided in to two components:

  1. Time spent on actual computation (Tcomp)
  2. Time spent on memory accesses (Tmem)

Typically profilers provide an estimate of the total time spent by a function. Is it possible to get an estimate of the time spent in terms of the above two components (Tcomp and Tmem)?


Solution

  • A notion of Arithmetic Intensity has been proposed by the Roofline model: https://crd.lbl.gov/departments/computer-science/PAR/research/roofline/. Simply said it defines the number of arithmetic instructions executed for each memory access.

    Computing the Arithmetic Intensity is usually implemented through the use of performance counters.