mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-08 18:17:48 +00:00
Don't include tests that error in the total score of the perf.js suite. [ci skip]
Former-commit-id: ea71d436ecec9297b2d991e9f17e3665a9e53d23
This commit is contained in:
36
perf/perf.js
36
perf/perf.js
@@ -182,23 +182,31 @@
|
|||||||
aHz = getHz(this[0]),
|
aHz = getHz(this[0]),
|
||||||
bHz = getHz(this[1]);
|
bHz = getHz(this[1]);
|
||||||
|
|
||||||
if (fastest.length > 1) {
|
for (var index = 0, length = this.length; index < length; index++) {
|
||||||
log('It\'s too close to call.');
|
var bench = this[index];
|
||||||
aHz = bHz = slowestHz;
|
if (bench.error) {
|
||||||
|
var errored = true;
|
||||||
|
log(bench.error);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
if (!errored) {
|
||||||
var percent = ((fastestHz / slowestHz) - 1) * 100;
|
if (fastest.length > 1) {
|
||||||
|
log('It\'s too close to call.');
|
||||||
|
aHz = bHz = slowestHz;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
var percent = ((fastestHz / slowestHz) - 1) * 100;
|
||||||
|
|
||||||
log(
|
log(
|
||||||
fastest[0].name + ' is ' +
|
fastest[0].name + ' is ' +
|
||||||
formatNumber(percent < 1 ? percent.toFixed(2) : Math.round(percent)) +
|
formatNumber(percent < 1 ? percent.toFixed(2) : Math.round(percent)) +
|
||||||
'% faster.'
|
'% faster.'
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
// add score adjusted for margin of error
|
||||||
|
score.a += aHz;
|
||||||
|
score.b += bHz;
|
||||||
}
|
}
|
||||||
// add score adjusted for margin of error
|
|
||||||
score.a += aHz;
|
|
||||||
score.b += bHz;
|
|
||||||
|
|
||||||
// remove current suite from queue
|
// remove current suite from queue
|
||||||
suites.shift();
|
suites.shift();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user