diff --git a/perf/perf.js b/perf/perf.js index 53d7bd7ba..55c8c397f 100644 --- a/perf/perf.js +++ b/perf/perf.js @@ -224,6 +224,12 @@ }, {});\ }\ }\ + if (typeof compact != "undefined") {\ + var uncompacted = numbers.slice();\ + uncompacted[2] = false;\ + uncompacted[6] = null;\ + uncompacted[18] = "";\ + }\ \ if (typeof countBy != "undefined" || typeof omit != "undefined") {\ var wordToNumber = {\ @@ -537,6 +543,20 @@ /*--------------------------------------------------------------------------*/ + suites.push( + Benchmark.Suite('`_.compact`') + .add(buildName, { + 'fn': 'lodash.compact(uncompacted)', + 'teardown': 'function compact(){}' + }) + .add(otherName, { + 'fn': '_.compact(uncompacted)', + 'teardown': 'function compact(){}' + }) + ); + + /*--------------------------------------------------------------------------*/ + suites.push( Benchmark.Suite('`_.contains` iterating an array') .add(buildName, '\ @@ -595,6 +615,18 @@ /*--------------------------------------------------------------------------*/ + suites.push( + Benchmark.Suite('`_.defaults`') + .add(buildName, '\ + lodash.defaults({ "key2": 2, "key6": 6, "key18": 18 }, object)' + ) + .add(otherName, '\ + _.defaults({ "key2": 2, "key6": 6, "key18": 18 }, object)' + ) + ); + + /*--------------------------------------------------------------------------*/ + suites.push( Benchmark.Suite('`_.difference`') .add(buildName, '\ @@ -723,6 +755,18 @@ /*--------------------------------------------------------------------------*/ + suites.push( + Benchmark.Suite('`_.extend`') + .add(buildName, '\ + lodash.extend({}, object)' + ) + .add(otherName, '\ + _.extend({}, object)' + ) + ); + + /*--------------------------------------------------------------------------*/ + suites.push( Benchmark.Suite('`_.filter` iterating an array') .add(buildName, '\