From 10e329f762a95d7d6b149b2f8e871c831e74079d Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Tue, 30 Dec 2014 21:15:52 -0600 Subject: [PATCH] Add `_.sortedIndex` benchmark. [ci skip] --- perf/perf.js | 36 +++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/perf/perf.js b/perf/perf.js index 495ce757a..b91ec3882 100644 --- a/perf/perf.js +++ b/perf/perf.js @@ -289,7 +289,7 @@ belt = this.name == buildName ? lodash : _;\ \ var date = new Date,\ - limit = 20,\ + limit = 50,\ regexp = /x/,\ object = {},\ objects = Array(limit),\ @@ -760,18 +760,6 @@ ) ); - suites.push( - Benchmark.Suite('`_.difference` iterating 200 elements') - .add(buildName, { - 'fn': 'lodash.difference(twoHundredValues, twoHundredValues2)', - 'teardown': 'function multiArrays(){}' - }) - .add(otherName, { - 'fn': '_.difference(twoHundredValues, twoHundredValues2)', - 'teardown': 'function multiArrays(){}' - }) - ); - suites.push( Benchmark.Suite('`_.difference` iterating 20 and 40 elements') .add(buildName, { @@ -784,6 +772,18 @@ }) ); + suites.push( + Benchmark.Suite('`_.difference` iterating 200 elements') + .add(buildName, { + 'fn': 'lodash.difference(twoHundredValues, twoHundredValues2)', + 'teardown': 'function multiArrays(){}' + }) + .add(otherName, { + 'fn': '_.difference(twoHundredValues, twoHundredValues2)', + 'teardown': 'function multiArrays(){}' + }) + ); + /*--------------------------------------------------------------------------*/ suites.push( @@ -1835,6 +1835,16 @@ /*--------------------------------------------------------------------------*/ + suites.push( + Benchmark.Suite('`_.sortedIndex`') + .add(buildName, '\ + lodash.sortedIndex(numbers, limit)' + ) + .add(otherName, '\ + _.sortedIndex(numbers, limit)' + ) + ); + suites.push( Benchmark.Suite('`_.sortedIndex` with `callback`') .add(buildName, {