mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-29 06:27:49 +00:00
Add _.reject benchmark.
Former-commit-id: 936a8b8915522abd5a64bbb2c7756a36a4af7c30
This commit is contained in:
44
perf/perf.js
44
perf/perf.js
@@ -1238,6 +1238,50 @@
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
suites.push(
|
||||
Benchmark.Suite('`_.reject` iterating an array')
|
||||
.add('Lo-Dash', '\
|
||||
lodash.reject(numbers, function(num) {\
|
||||
return num % 2;\
|
||||
})'
|
||||
)
|
||||
.add('Underscore', '\
|
||||
_.reject(numbers, function(num) {\
|
||||
return num % 2;\
|
||||
})'
|
||||
)
|
||||
);
|
||||
|
||||
suites.push(
|
||||
Benchmark.Suite('`_.reject` iterating an array with `thisArg` (slow path)')
|
||||
.add('Lo-Dash', '\
|
||||
lodash.reject(numbers, function(num, index) {\
|
||||
return this["key" + index] % 2;\
|
||||
}, object)'
|
||||
)
|
||||
.add('Underscore', '\
|
||||
_.reject(numbers, function(num, index) {\
|
||||
return this["key" + index] % 2;\
|
||||
}, object)'
|
||||
)
|
||||
);
|
||||
|
||||
suites.push(
|
||||
Benchmark.Suite('`_.reject` iterating an object')
|
||||
.add('Lo-Dash', '\
|
||||
lodash.reject(object, function(num) {\
|
||||
return num % 2\
|
||||
})'
|
||||
)
|
||||
.add('Underscore', '\
|
||||
_.reject(object, function(num) {\
|
||||
return num % 2\
|
||||
})'
|
||||
)
|
||||
);
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
suites.push(
|
||||
Benchmark.Suite('`_.shuffle`')
|
||||
.add('Lo-Dash', '\
|
||||
|
||||
Reference in New Issue
Block a user