mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-29 06:27:49 +00:00
Add _.invoke benchmark to perf.js and a link to the compatibility changes wiki entry in README.md.
Former-commit-id: 51296709ea8d9dd6e951530b9874b90af3c764a2
This commit is contained in:
37
perf/perf.js
37
perf/perf.js
@@ -602,12 +602,12 @@
|
||||
suites.push(
|
||||
Benchmark.Suite('`_.find` iterating an object')
|
||||
.add('Lo-Dash', function() {
|
||||
lodash.find(numbers, function(value, key) {
|
||||
lodash.find(object, function(value, key) {
|
||||
return /\D9$/.test(key);
|
||||
});
|
||||
})
|
||||
.add('Underscore', function() {
|
||||
_.find(numbers, function(value, key) {
|
||||
_.find(object, function(value, key) {
|
||||
return /\D9$/.test(key);
|
||||
});
|
||||
})
|
||||
@@ -727,6 +727,39 @@
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
suites.push(
|
||||
Benchmark.Suite('`_.invoke` iterating an array')
|
||||
.add('Lo-Dash', function() {
|
||||
lodash.invoke(numbers, 'toFixed', '2');
|
||||
})
|
||||
.add('Underscore', function() {
|
||||
_.invoke(numbers, 'toFixed', '2');
|
||||
})
|
||||
);
|
||||
|
||||
suites.push(
|
||||
Benchmark.Suite('`_.invoke` with a function for `methodName` iterating an array')
|
||||
.add('Lo-Dash', function() {
|
||||
lodash.invoke(numbers, String.prototype.split, '');
|
||||
})
|
||||
.add('Underscore', function() {
|
||||
_.invoke(numbers, String.prototype.split, '');
|
||||
})
|
||||
);
|
||||
|
||||
suites.push(
|
||||
Benchmark.Suite('`_.invoke` iterating an object')
|
||||
.add('Lo-Dash', function() {
|
||||
lodash.invoke(object, 'toFixed', '2');
|
||||
})
|
||||
.add('Underscore', function() {
|
||||
_.invoke(object, 'toFixed', '2');
|
||||
})
|
||||
);
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
suites.push(
|
||||
Benchmark.Suite('`_.isEqual` comparing primitives and objects (edge case)')
|
||||
.add('Lo-Dash', {
|
||||
|
||||
Reference in New Issue
Block a user