mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-29 06:27:49 +00:00
Add a benchmark for _.some with thisArg and avoid corrupting the aggregate score if a single benchmark errors. [ci skip]
Former-commit-id: 2042fdaab870ad2de2fb4938f5033d21f3dd1ae3
This commit is contained in:
17
perf/perf.js
17
perf/perf.js
@@ -78,7 +78,8 @@
|
||||
* @returns {Number} Returns the adjusted Hz.
|
||||
*/
|
||||
function getHz(bench) {
|
||||
return 1 / (bench.stats.mean + bench.stats.moe);
|
||||
var result = 1 / (bench.stats.mean + bench.stats.moe);
|
||||
return isFinite(result) ? result : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1419,6 +1420,20 @@
|
||||
)
|
||||
);
|
||||
|
||||
suites.push(
|
||||
Benchmark.Suite('`_.some` with `thisArg` iterating an array (slow path)')
|
||||
.add(buildName, '\
|
||||
lodash.some(objects, function(value, index) {\
|
||||
return this["key" + index] == 19;\
|
||||
}, object)'
|
||||
)
|
||||
.add(otherName, '\
|
||||
_.some(objects, function(value, index) {\
|
||||
return this["key" + index] == 19;\
|
||||
}, object)'
|
||||
)
|
||||
);
|
||||
|
||||
suites.push(
|
||||
Benchmark.Suite('`_.some` iterating an object')
|
||||
.add(buildName, '\
|
||||
|
||||
Reference in New Issue
Block a user