Skip to content

Commit 5856536

Browse files
Victor Miurasmfr
authored andcommitted
Filter to animation frames before bootstrap sampling
Before we were applying bootstrap population resampling across all frame samples, and filtering out mutation frames at regression time. This could cause some odd results due to for example having only mutation samples in some populations. This change filters out mutation frames prior to bootstrap to avoid these issues.
1 parent 9236d48 commit 5856536

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

MotionMark/resources/runner/results.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,8 +254,11 @@ class ScoreCalculator {
254254
experimentResult[Strings.json.measurements.stdev] = timeComplexity.standardDeviation();
255255
experimentResult[Strings.json.measurements.percent] = timeComplexity.percentage();
256256

257+
var frameTypeIndex = regressionResult.samples.fieldMap[Strings.json.frameType];
258+
var animationSamplesData = regressionResult.samples.data.filter(
259+
(sample) => sample[frameTypeIndex] == Strings.json.animationFrameType);
257260
const bootstrapIterations = this._runData.options[Strings.json.bootstrapIterations];
258-
const bootstrapResult = Regression.bootstrap(regressionResult.samples.data, bootstrapIterations, function(resampleData) {
261+
const bootstrapResult = Regression.bootstrap(animationSamplesData, bootstrapIterations, function(resampleData) {
259262
const complexityIndex = regressionResult.samples.fieldMap[complexityKey];
260263
resampleData.sort(function(a, b) {
261264
return a[complexityIndex] - b[complexityIndex];

0 commit comments

Comments
 (0)