<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">If you have a 0.004s granularity, and you want to identify small (1% changes) you’ll probably need benchmarks running at least 0.8s.<div> <br><div><div>On Jan 16, 2014, at 6:21 PM, Chandler Carruth <<a href="mailto:chandlerc@google.com">chandlerc@google.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jan 16, 2014 at 6:09 PM, David Blaikie <span dir="ltr"><<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Thu, Jan 16, 2014 at 5:32 PM, Tobias Grosser <span dir="ltr"><<a href="mailto:tobias@grosser.es" target="_blank">tobias@grosser.es</a>></span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>On 01/17/2014 02:17 AM, David Blaikie wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Right - you usually won't see a normal distribution in the noise of test<br>
results. You'll see results clustered around the lower bound with a long<br>
tail of slower and slower results. Depending on how many samples you do it<br>
might be appropriate to take the mean of the best 3, for example - but the<br>
general approach of taking the fastest N does have some basis in any case.<br>
<br>
Not necessarily the right answer, the only right answer, etc.<br>
</blockquote>
<br></div>
Interesting. In fact I had the very same thoughts at the beginning.<br>
<br>
However, when looking at my test results the common pattern looks like this example:<br>
<br>
<a href="http://llvm.org/perf/db_default/v4/nts/graph?show_all_points=yes&moving_window_size=10&plot.0=34.95.3&submit=Update" target="_blank">http://llvm.org/perf/db_<u></u>default/v4/nts/graph?show_all_<u></u>points=yes&moving_window_size=<u></u>10&plot.0=34.95.3&submit=<u></u>Update</a><br>



<br>
The run-time of a test case is very consistently one of several fixed values. The distribution of the different times is very consistent and seems to form, in fact, something like a normal distribution (more in the center, less at the border).<br>



<br>
The explanation I have here is that the machine is by itself in fact not very noisy. Instead, changes of the execution context (e.g. due to allocation of memory at a different location) influences the performance. If we, by luck, have a run where all 'choices' have been optimal we get minimal performance. However, in case of several independent factors, it is more likely that we get a non-optimal configuration that yields a value in the middle. Consequently, the minimal seems to be a non-optimal choice here.<br>



<br>
I understand that there may be some 'real' noise values, but as the median does not seem to be affected very much by 'extremal' values, I have the feeling it should be reasonable robust to such noise.<br>



<br>
Have you seen examples where the median value gives a wrong impression<br>
regarding performance?<br></blockquote><div><br></div></div><div>I have - and I've also seen the kind of results you're seeing too. One of the issues here is the quantization of results due to very short tests and not very granular timing. This is perhaps the only reason the results even /have/ a median (with finer grained timing and longer tests I expect you'd see fewer results with exactly the same time - yes, you might be in a situation where the exact runtimes repeat due to very short tests being wholely scheduled in one way or another - but in that case you'll get wide, solid swings depending on that scheduling behavior which is also unhelpful) in your results.<br>


<br>It's one of the reasons I gave up on trying to do timing on Linux - I couldn't get a machine quiet enough to look real. Though in the long run I still did tend to get results for many tests that were clustered around a minima with outliers going upwards... <br>

<br>I'm perhaps rambling a bit here, and I'm by no means an authority on this subject (I tried and failed - gave up & worked on other things instead) but I think so long as the data is that noisy and quantized like that, I'm not sure how useful it'll be & not sure if it's the best data to be trying to figure out data processing on. Maybe I'm wrong, perhaps this is as good as that data can get and we do need an answer to how to handle it.</div>
</blockquote></div></div><div class="gmail_extra"><br></div><div class="gmail_extra">To jump into this thread mid way, I just wanted to point out that this kind of step-function in timings is almost *always* a sign of an extremely coarse timer. If we can't do better than .4ms (guessing from the graph) of resolution in the timer, we're not going to be able to reasonable measure changes in the CPU-execution times of these tests.</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">I would really like to see us move toward counting cycles of an un-throttled processor, and then normalizing that into seconds. If we can't get very accurate (tick granularity) timings, I don't think we can draw reasonable conclusions without *very* long test runs.</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">I've long wanted the LNT test suite to run (on linux at least) under 'perf stat' or some other external measurement tool that has fine grained and accurate timing information available in addition to cycle counts and other things that are even more resilient to context switchings, CPU migrations, etc.</div>
</div>
_______________________________________________<br>LLVM Developers mailing list<br><a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu">http://llvm.cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br></blockquote></div><br></div></body></html>