mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-11 03:17:49 +00:00
Fix typo in _.values benchmark and tweak how percents are displayed in perf.js.
Former-commit-id: 49be4600561e55e134d3152b00c765e305af98b5
This commit is contained in:
@@ -149,9 +149,9 @@
|
|||||||
else {
|
else {
|
||||||
var fastestHz = fastest[0] == this[0] ? lodashHz : underscoreHz,
|
var fastestHz = fastest[0] == this[0] ? lodashHz : underscoreHz,
|
||||||
slowestHz = slowest[0] == this[0] ? lodashHz : underscoreHz,
|
slowestHz = slowest[0] == this[0] ? lodashHz : underscoreHz,
|
||||||
percent = formatNumber(Math.round(((fastestHz / slowestHz) - 1) * 100));
|
percent = ((fastestHz / slowestHz) - 1) * 100;
|
||||||
|
|
||||||
log(fastest[0].name + ' is ' + percent + '% faster.');
|
log(fastest[0].name + ' is ' + formatNumber(percent < 1 ? percent.toFixed(2) : Math.round(percent)) + '% faster.');
|
||||||
}
|
}
|
||||||
// add score adjusted for margin of error
|
// add score adjusted for margin of error
|
||||||
score.lodash += lodashHz;
|
score.lodash += lodashHz;
|
||||||
@@ -604,10 +604,10 @@
|
|||||||
suites.push(
|
suites.push(
|
||||||
Benchmark.Suite('values')
|
Benchmark.Suite('values')
|
||||||
.add('Lo-Dash', function() {
|
.add('Lo-Dash', function() {
|
||||||
lodash.values(objects);
|
lodash.values(object);
|
||||||
})
|
})
|
||||||
.add('Underscore', function() {
|
.add('Underscore', function() {
|
||||||
_.values(objects);
|
_.values(object);
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user