summaryrefslogtreecommitdiff
path: root/perf
diff options
context:
space:
mode:
authorAlexander Early <alexander.early@gmail.com>2017-04-02 23:48:07 -0700
committerAlexander Early <alexander.early@gmail.com>2017-04-02 23:48:07 -0700
commitcc06eaca633e2b99951b2afdb26ee4d9f12d74f1 (patch)
tree6369825ec3d6be2812f79ad38fcaf19be4e73480 /perf
parent1af382d62b535f255a699fa03a4043faa5d3514e (diff)
downloadasync-cc06eaca633e2b99951b2afdb26ee4d9f12d74f1.tar.gz
add auto benchmark
Diffstat (limited to 'perf')
-rw-r--r--perf/suites.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/perf/suites.js b/perf/suites.js
index ca400dc..677517c 100644
--- a/perf/suites.js
+++ b/perf/suites.js
@@ -234,6 +234,28 @@ module.exports = [{
async.waterfall(tasks, done);
}
}, {
+ name: "auto",
+ args: [
+ [5],
+ [10],
+ [100]
+ ],
+ setup: function setup(count) {
+ tasks = {
+ dep1: function (cb) { cb(null, 1); }
+ };
+ _.times(count, function(n) {
+ var task = ['dep' + (n+1), function(results, cb) {
+ setImmediate(cb, null, n);
+ }];
+ if (n > 2) task.unshift('dep' + n);
+ tasks['dep' + (n+2)] = task;
+ });
+ },
+ fn: function(async, done) {
+ async.auto(tasks, done);
+ }
+}, {
name: "queue",
args: [
[1000],