mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-07 18:07:49 +00:00
Ensure _.isEqual works correctly for objects from another document and add _.clone benchmark.
Former-commit-id: b1ef745ec6c24e8ea0c8fae304ead80c60dfd5aa
This commit is contained in:
27
perf/perf.js
27
perf/perf.js
@@ -132,7 +132,10 @@
|
||||
|
||||
// potentially expensive
|
||||
for (index = 0; index < this.count; index++) {
|
||||
bindAllObjects[index] = belt.clone(lodash);
|
||||
bindAllObjects[index] = belt.reduce(funcNames, function(object, funcName) {
|
||||
object[funcName] = lodash[funcName];
|
||||
return object;
|
||||
}, {});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -515,6 +518,18 @@
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
suites.push(
|
||||
Benchmark.Suite('`_.clone` with an object')
|
||||
.add('Lo-Dash', function() {
|
||||
lodash.clone(object);
|
||||
})
|
||||
.add('Underscore', function() {
|
||||
_.clone(object);
|
||||
})
|
||||
);
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
suites.push(
|
||||
Benchmark.Suite('`_.countBy` with `callback` iterating an array')
|
||||
.add('Lo-Dash', function() {
|
||||
@@ -1145,16 +1160,6 @@
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
suites.push(
|
||||
Benchmark.Suite('`_.size` with an array')
|
||||
.add('Lo-Dash', function() {
|
||||
lodash.size(numbers);
|
||||
})
|
||||
.add('Underscore', function() {
|
||||
_.size(numbers);
|
||||
})
|
||||
);
|
||||
|
||||
suites.push(
|
||||
Benchmark.Suite('`_.size` with an object')
|
||||
.add('Lo-Dash', function() {
|
||||
|
||||
Reference in New Issue
Block a user