From afbb2c338b8d8ecfca55b008c66b41a1633562a0 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Wed, 30 Jan 2013 08:58:55 -0800 Subject: [PATCH] Add `_.findWhere` benchmark and remove`new bound` benchmark. Former-commit-id: baef485421cf6419450e3bc2a14f36e7e7c437c3 --- perf/perf.js | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/perf/perf.js b/perf/perf.js index 8349d1055..a1988dc1c 100644 --- a/perf/perf.js +++ b/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(