mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-09 18:37:50 +00:00
Update perf/perf.js to correctly load libs when running from the command line.
This commit is contained in:
18
perf/perf.js
18
perf/perf.js
@@ -101,6 +101,12 @@
|
|||||||
lodash.noConflict()
|
lodash.noConflict()
|
||||||
));
|
));
|
||||||
|
|
||||||
|
/** Load Underscore. */
|
||||||
|
var _ = root.underscore || (root.underscore = (
|
||||||
|
_ = load('../vendor/underscore/underscore.js') || root._,
|
||||||
|
_._ || _
|
||||||
|
));
|
||||||
|
|
||||||
/** Load Benchmark.js. */
|
/** Load Benchmark.js. */
|
||||||
var Benchmark = root.Benchmark || (root.Benchmark = (
|
var Benchmark = root.Benchmark || (root.Benchmark = (
|
||||||
Benchmark = load('../vendor/benchmark.js/benchmark.js') || root.Benchmark,
|
Benchmark = load('../vendor/benchmark.js/benchmark.js') || root.Benchmark,
|
||||||
@@ -108,12 +114,6 @@
|
|||||||
Benchmark.runInContext(lodash.extend({}, root, { '_': lodash }))
|
Benchmark.runInContext(lodash.extend({}, root, { '_': lodash }))
|
||||||
));
|
));
|
||||||
|
|
||||||
/** Load Underscore. */
|
|
||||||
var _ = root._ || (root._ = (
|
|
||||||
_ = load('../vendor/underscore/underscore.js') || root._,
|
|
||||||
_._ || _
|
|
||||||
));
|
|
||||||
|
|
||||||
/*--------------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------------*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -281,7 +281,7 @@
|
|||||||
lodash.extend(Benchmark.options, {
|
lodash.extend(Benchmark.options, {
|
||||||
'async': true,
|
'async': true,
|
||||||
'setup': '\
|
'setup': '\
|
||||||
var _ = global._,\
|
var _ = global.underscore,\
|
||||||
lodash = global.lodash,\
|
lodash = global.lodash,\
|
||||||
belt = this.name == buildName ? lodash : _;\
|
belt = this.name == buildName ? lodash : _;\
|
||||||
\
|
\
|
||||||
@@ -348,8 +348,8 @@
|
|||||||
square = function(v) { return v * v; };\
|
square = function(v) { return v * v; };\
|
||||||
\
|
\
|
||||||
var largeArray = belt.range(10000),\
|
var largeArray = belt.range(10000),\
|
||||||
_chaining = _.chain ? _(largeArray).chain() : _(largeArray),\
|
_chaining = _(largeArray).chain(),\
|
||||||
lodashChaining = lodash(largeArray);\
|
lodashChaining = lodash(largeArray).chain();\
|
||||||
}\
|
}\
|
||||||
if (typeof compact != "undefined") {\
|
if (typeof compact != "undefined") {\
|
||||||
var uncompacted = numbers.slice();\
|
var uncompacted = numbers.slice();\
|
||||||
|
|||||||
Reference in New Issue
Block a user