Performance Analysis

Which statement about instrumentation profilers, which insert timing code at function entries and exits, is correct?

  1. AThe recording takes no time at all
  2. BThey record exact call counts and similar, but the recording itself takes time and can distort results, especially in programs with many small functions
  3. CNo program has function entries and exits
Show answer and explanation

Answer: B. They record exact call counts and similar, but the recording itself takes time and can distort results, especially in programs with many small functions

Instrumentation records every function call, giving complete and exact counts and call relationships. But recording overhead is added to every call, so in programs calling very many small functions, recording time can exceed the real work. So sampling is used for time proportions and instrumentation for exact counts.

  • A. The recording instructions take time to execute.
  • B. Correct. Measuring changes what is measured.
  • C. Every function has an entry and an exit.
Practice this topic Back to topic

More Performance Analysis questions

  1. In program performance analysis, what is a hotspot?
  2. How is a flame graph, used to present profiling results, read?
  3. Which is an example of what CPU performance counters (the PMU) can count?
  4. Performance counters show a program's IPC is very low at 0.3, with many last-level cache misses. Which pairs the likely situation with a remedy?
  5. Performance counters reveal very frequent branch mispredictions. Which is a suitable remedy?