mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-29 06:27:49 +00:00
Add isType benchmarks.
Former-commit-id: 875af51200d60eb6105eb36ab090e9f307a15340
This commit is contained in:
32
perf/perf.js
32
perf/perf.js
@@ -154,7 +154,9 @@
|
||||
belt = this.name == "Lo-Dash" ? lodash : _;\
|
||||
\
|
||||
var index,\
|
||||
date = new Date,\
|
||||
limit = 20,\
|
||||
regexp = /x/,\
|
||||
object = {},\
|
||||
objects = Array(limit),\
|
||||
numbers = Array(limit),\
|
||||
@@ -941,6 +943,36 @@
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
suites.push(
|
||||
Benchmark.Suite('`_.isArguments`, `_.isDate`, `_.isFunction`, `_.isNumber`, `_.isRegExp`')
|
||||
.add('Lo-Dash', '\
|
||||
lodash.isArguments(arguments);\
|
||||
lodash.isArguments(object);\
|
||||
lodash.isDate(date);\
|
||||
lodash.isDate(object);\
|
||||
lodash.isFunction(lodash);\
|
||||
lodash.isFunction(object);\
|
||||
lodash.isNumber(1);\
|
||||
lodash.isNumber(object);\
|
||||
lodash.isRegExp(regexp);\
|
||||
lodash.isRegExp(object);'
|
||||
)
|
||||
.add('Underscore', '\
|
||||
_.isArguments(arguments);\
|
||||
_.isArguments(object);\
|
||||
_.isDate(date);\
|
||||
_.isDate(object);\
|
||||
_.isFunction(_);\
|
||||
_.isFunction(object);\
|
||||
_.isNumber(1);\
|
||||
_.isNumber(object);\
|
||||
_.isRegExp(regexp);\
|
||||
_.isRegExp(object);'
|
||||
)
|
||||
);
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
suites.push(
|
||||
Benchmark.Suite('`_.keys` (uses native `Object.keys` if available)')
|
||||
.add('Lo-Dash', '\
|
||||
|
||||
Reference in New Issue
Block a user