When comparing two runs (means) of different benchmark tests I use an unpaired two-sample t-test assuming equal variance.
The problem I've run into is this often results in the same benchmark test result being statistically significantly different from re-runs of the same benchmark test on the same computer/device. I noticed that from run to rerun the difference can swing about ~5%
. What is the correct way to account/allow for this?
Update (1.22.2012 @10pm)
Here is a link to a test page that will run the same benchmark 30
times (please be patient) and then create a histogram of the mean
values represented as a percent of the most frequent mean
value (lowest mean
value to the far-left, highest to the far right).
Each one of the 30
benchmark runs repeats the test, collecting samples, as much as possible for 5
seconds. So it takes about 2 ½
minutes to finish all 30
runs.
In this example the sample size for each of the 30
benchmark runs in Chrome will range from something like 86
to 93
and in Mobile Safari something like 47
to 53
.
Even though the results are displayed in operations per second the samples are composed of the time, in seconds, it takes to execute a test one time. This results in mean
values that are very small. In this example, in Chrome, they are as small as 0.0001135
and 0.0001137
and 0.0001128
.
When the 30
benchmarks are finished the result cells are highlighted. The green
colored result cells are those that are the fastest and statistically indistinguishable from each other (if this were perfect all cells would be green
).
Here are some screenshots of the histogram from Chrome and Mobile Safari:
Chrome #1, Chrome #2, iPhone results #1, iPhone log #1, iPhone histogram #1, iPhone histogram #2
The distribution is inconsistent from test to re-test and from Chrome to Mobile Safari. This may be because the means
are so small. I currently clip the mean
values, for the histogram, to 7
decimal places.
Update (1.23.2012 @2:30am)
Here is some example data that would be used to generate a histogram:
{
// "the mean": frequency the mean was computed
"0.0001465":1,
"0.0001562":1,
"0.0001564":1,
...
}
When I clip the means
to 5
decimal places and rerun I get data like:
{ "0.00012": 30 }
All 30 tests have the same mean
when clipped to 5
decimal places.
Update (1.25.2012 @12:40am)
In my update from 1.22.2012 I mentioned that each benchmark run collects samples for 5
seconds. Each sample is created by executing the test as many times as possible in ~50
milliseconds. Timer resolution in JS in 1ms
so to get measurement uncertainty of ~1%
I (1/2)/0.01 = 50)
. After it's clocked I add the computed time per call (timeTaken / numberOfCalls) to the sample and repeat the process collecting samples for 5
seconds.
5
seconds. So the sample size in Chrome may be something like86
to93
. $\endgroup$