[LLVMdev] Use perf tool for more accurate time measuring on Linux

Chandler Carruth chandlerc at google.com
Fri May 16 12:51:55 PDT 2014


On Fri, May 16, 2014 at 12:45 PM, Yi Kong <kongy.dev at gmail.com> wrote:

> On 16 May 2014 18:40, "Chandler Carruth" <chandlerc at google.com> wrote:
> >
> > Why not use the cycle count which perf exposes from hardware? That would
> seem even better to me, but data would be better. =]
>
> That's an interesting idea. However I'm concerned if that will miss some
> aspects of compiler optimization. For example frequent cache misses would
> have much smaller impact on the result if the processor goes to lower
> frequency during the stall period. Nonetheless it's definitely worth to try
> out.
>
Sure, but we should disable frequency throttling on any machine from which
we want numbers that look *remotely* stable.

The other thing you might try doing while you're wrapping these tools is to
use schedtool to pin the process to a single core. On most modern x86
machines you can see 2-3% swing in lots of small details, and when the
process migrates between cores this makes the numbers very hard to analyze.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140516/df15380a/attachment.html>


More information about the llvm-dev mailing list