Remove compiling from _.every, _.filter, and _.some and add related benchmarks.

Former-commit-id: 545195dc7085c1294ad8709f44fddb0c3c6a0545
This commit is contained in:
John-David Dalton
2012-10-19 00:53:48 -07:00
parent 5f5f1b1e09
commit 425b976cc0
5 changed files with 151 additions and 82 deletions

View File

@@ -693,6 +693,36 @@
/*--------------------------------------------------------------------------*/
suites.push(
Benchmark.Suite('`_.every` iterating an array')
.add(buildName, '\
lodash.every(numbers, function(num) {\
return num + "";\
})'
)
.add(otherName, '\
_.every(numbers, function(num) {\
return num + "";\
})'
)
);
suites.push(
Benchmark.Suite('`_.every` iterating an object')
.add(buildName, '\
lodash.every(object, function(num) {\
return num + "";\
})'
)
.add(otherName, '\
_.every(object, function(num) {\
return num + "";\
})'
)
);
/*--------------------------------------------------------------------------*/
suites.push(
Benchmark.Suite('`_.filter` iterating an array')
.add(buildName, '\
@@ -1331,6 +1361,36 @@
/*--------------------------------------------------------------------------*/
suites.push(
Benchmark.Suite('`_.some` iterating an array')
.add(buildName, '\
lodash.some(numbers, function(num) {\
return num == 19;\
})'
)
.add(otherName, '\
_.some(numbers, function(num) {\
return num == 19;\
})'
)
);
suites.push(
Benchmark.Suite('`_.some` iterating an object')
.add(buildName, '\
lodash.some(object, function(num) {\
return num == 19;\
})'
)
.add(otherName, '\
_.some(object, function(num) {\
return num == 19;\
})'
)
);
/*--------------------------------------------------------------------------*/
suites.push(
Benchmark.Suite('`_.sortBy` with `callback`')
.add(buildName, '\