Add isType benchmarks.

Former-commit-id: 875af51200d60eb6105eb36ab090e9f307a15340
This commit is contained in:
John-David Dalton
2012-08-21 01:59:56 -07:00
parent e60bbc2fb7
commit 5b9271ccfe

View File

@@ -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', '\