mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-29 06:27:49 +00:00
Add _.findWhere benchmark and removenew bound benchmark.
Former-commit-id: baef485421cf6419450e3bc2a14f36e7e7c437c3
This commit is contained in:
24
perf/perf.js
24
perf/perf.js
@@ -205,11 +205,9 @@
|
||||
};\
|
||||
\
|
||||
var lodashBoundNormal = lodash.bind(func, contextObject),\
|
||||
lodashBoundCtor = lodash.bind(ctor, contextObject),\
|
||||
lodashBoundPartial = lodash.bind(func, contextObject, "hi");\
|
||||
\
|
||||
var _boundNormal = _.bind(func, contextObject),\
|
||||
_boundCtor = _.bind(ctor, contextObject),\
|
||||
_boundPartial = _.bind(func, contextObject, "hi");\
|
||||
}\
|
||||
\
|
||||
@@ -534,18 +532,6 @@
|
||||
})
|
||||
);
|
||||
|
||||
suites.push(
|
||||
Benchmark.Suite('bound and called in a `new` expression, i.e. `new bound` (edge case)')
|
||||
.add(buildName, {
|
||||
'fn': 'new lodashBoundCtor()',
|
||||
'teardown': 'function bind(){}'
|
||||
})
|
||||
.add(otherName, {
|
||||
'fn': 'new _boundCtor()',
|
||||
'teardown': 'function bind(){}'
|
||||
})
|
||||
);
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
suites.push(
|
||||
@@ -870,6 +856,16 @@
|
||||
)
|
||||
);
|
||||
|
||||
suites.push(
|
||||
Benchmark.Suite('`_.find` with `properties`')
|
||||
.add(buildName, '\
|
||||
lodash.find(objects, { "num": 9 });'
|
||||
)
|
||||
.add(otherName, '\
|
||||
_.findWhere(objects, { "num": 9 });'
|
||||
)
|
||||
);
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
suites.push(
|
||||
|
||||
Reference in New Issue
Block a user