Performance Analysis
Which statement about instrumentation profilers, which insert timing code at function entries and exits, is correct?
- AThe recording takes no time at all
- BThey record exact call counts and similar, but the recording itself takes time and can distort results, especially in programs with many small functions
- 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.