Reliability of Xcode Instrument's disassembly time profiling

后端 未结 2 581
别那么骄傲
别那么骄傲 2021-01-11 14:17

I\'ve profiled my code using Instrument\'s time profiler, and zooming in to the disassembly, here\'s a snippet of its results:

I wouldn\'t expect a mo

2条回答
  •  说谎
    说谎 (楼主)
    2021-01-11 14:58

    Is this true and known?

    Yes, it is a known problem with profiling tools on Intel x86. I've observed it (time spent suspiciously assigned to seemingly innocent instructions) both with Linux perf_events and Intel VTune. It has also been reported elsewhere by other people.

    A better and more honest visualization of collected results would have summed up all samples inside every basic block, and demonstrated the resulting value associated with a basic block, not its individual instructions. Not 100% fool-proof but a bit better and honest,

    Or is there some option I need to use to obtain reliable results?

    I do not know if newer profiling hardware, namely tools based on Intel Processor Trace (available starting from Broadwell, but improved in Skylake) instead of older PEBS, would give more accurate data. I guess one needs to experiment with such tools first.

提交回复
热议问题