Mac Instruments Time profiling shows wrong heaviest back trace?

439 Views Asked by At

I am using the Instruments to profile a very simple program. Here is the result:

result

My question is: why the heaviest back trace are annotated on a very simple line of code? I think that line only needs some ALU instructions to implement. Is this a bug or I missed something?

1

There are 1 best solutions below

0
On BEST ANSWER

I see nothing unusual in the screenshot you linked to. The 99x line in your screenshot has nothing to do with the heaviness of the backtrace. It is the line of code where Instruments recorded the most samples. The 99x line is inside a loop. Code inside loops is going to execute more often and have more samples.