0

We have been using perf to try and understand how a c++ linux proces has been doing as well as how it has changed when exposed to profile guided optimizations.

We use it to capture things like CPU utilization, also PMU counters like ipc, branch-mpki etc.

Does capturing/sampling these performance counters/events slow down execution or effect performance in any meaningful way?

We have been gathering benchmark results, while also capturing these performance counters/events. Is this advisable?

Gr-Disarray
  • 514
  • 1
  • 6
  • 17
  • Running more programs at the same time does slow down execution, yes. You would hope that it wouldn't totally screw up the measurements, and since people do find that perf is useful, I guess it doesn't. – user253751 Aug 10 '22 at 16:12
  • Put it shortly, yes, it does, like nearly any profiling method. But the impact is generally small (ie. not meant to be used in production). See this previous post: https://stackoverflow.com/questions/2794188/performance-overhead-of-perf-event-subsystem-in-linux-kernel . You can tweak perf so to reduce the overhead. The probing frequency, number of events, stack tracing etc. are parameters impacting performance. Note that perf impact the scheduling of programs that can behave differently because of that though it is rare. Profiling is ruled by quantum mechanics: observers impact the measures – Jérôme Richard Aug 10 '22 at 16:15

0 Answers0