Skip to content

Commit 465dd49

Browse files
vmiurasmfr
authored andcommitted
Make the 'slope' profile the default profile.
The 'flat' profile was added back in https://commits.webkit.org/177081@main to work around issues in a test that is no longer used. The consensus is that the 'flat' profile can generate bad estimated results. Remove this as a fallback profile. Fixes #32
1 parent c0a884c commit 465dd49

File tree

1 file changed

+16
-23
lines changed

1 file changed

+16
-23
lines changed

MotionMark/resources/statistics.js

Lines changed: 16 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -180,46 +180,39 @@ Regression = Utilities.createClass(
180180
function(samples, getComplexity, getFrameLength, startIndex, endIndex, options)
181181
{
182182
const desiredFrameLength = options.desiredFrameLength;
183-
var bestProfile;
183+
var profile;
184184

185185
if (!options.preferredProfile || options.preferredProfile == Strings.json.profiles.slope) {
186-
var slope = this._calculateRegression(samples, getComplexity, getFrameLength, startIndex, endIndex, {
186+
profile = this._calculateRegression(samples, getComplexity, getFrameLength, startIndex, endIndex, {
187187
shouldClip: true,
188188
s1: desiredFrameLength,
189189
t1: 0
190190
});
191-
if (!bestProfile || slope.error < bestProfile.error) {
192-
bestProfile = slope;
193-
this.profile = Strings.json.profiles.slope;
194-
}
191+
this.profile = Strings.json.profiles.slope;
195192
}
196-
if (!options.preferredProfile || options.preferredProfile == Strings.json.profiles.flat) {
197-
var flat = this._calculateRegression(samples, getComplexity, getFrameLength, startIndex, endIndex, {
193+
else if (options.preferredProfile == Strings.json.profiles.flat) {
194+
profile = this._calculateRegression(samples, getComplexity, getFrameLength, startIndex, endIndex, {
198195
shouldClip: true,
199196
s1: desiredFrameLength,
200197
t1: 0,
201198
t2: 0
202199
});
203-
204-
if (!bestProfile || flat.error < bestProfile.error) {
205-
bestProfile = flat;
206-
this.profile = Strings.json.profiles.flat;
207-
}
200+
this.profile = Strings.json.profiles.flat;
208201
}
209202

210203
this.startIndex = Math.min(startIndex, endIndex);
211204
this.endIndex = Math.max(startIndex, endIndex);
212205

213-
this.complexity = bestProfile.complexity;
214-
this.s1 = bestProfile.s1;
215-
this.t1 = bestProfile.t1;
216-
this.s2 = bestProfile.s2;
217-
this.t2 = bestProfile.t2;
218-
this.stdev1 = bestProfile.stdev1;
219-
this.stdev2 = bestProfile.stdev2;
220-
this.n1 = bestProfile.n1;
221-
this.n2 = bestProfile.n2;
222-
this.error = bestProfile.error;
206+
this.complexity = profile.complexity;
207+
this.s1 = profile.s1;
208+
this.t1 = profile.t1;
209+
this.s2 = profile.s2;
210+
this.t2 = profile.t2;
211+
this.stdev1 = profile.stdev1;
212+
this.stdev2 = profile.stdev2;
213+
this.n1 = profile.n1;
214+
this.n2 = profile.n2;
215+
this.error = profile.error;
223216
}, {
224217

225218
valueAt: function(complexity)

0 commit comments

Comments
 (0)