var _=require("lodash"),tasks;module.exports=[{name:"each",args:[[10],[300],[1e4]],setup:function(n){tasks=_.range(n)},fn:function(n,e){n.each(tasks,function(e,t){n.setImmediate(t)},e)}},{name:"eachSeries",args:[[10],[300],[1e4]],setup:function(n){tasks=_.range(n)},fn:function(n,e){n.eachSeries(tasks,function(e,t){n.setImmediate(t)},e)}},{name:"eachLimit",args:[[10],[300],[1e4]],setup:function(n){tasks=_.range(n)},fn:function(n,e){n.eachLimit(tasks,4,function(e,t){n.setImmediate(t)},e)}},{name:"map",args:[[10],[300],[1e4]],setup:function(n){tasks=_.range(n)},fn:function(n,e){n.map(tasks,function(e,t){n.setImmediate(t)},e)}},{name:"mapSeries",args:[[10],[300],[1e4]],setup:function(n){tasks=_.range(n)},fn:function(n,e){n.mapSeries(tasks,function(e,t){n.setImmediate(t)},e)}},{name:"mapLimit",args:[[10],[300],[1e4]],setup:function(n){tasks=_.range(n)},fn:function(n,e){n.mapLimit(tasks,4,function(e,t){n.setImmediate(t)},e)}},{name:"eachOf",args:[[10],[300],[1e4]],setup:function(n){tasks=_.range(n)},fn:function(n,e){n.eachOf(tasks,function(e,t,s){n.setImmediate(s)},e)}},{name:"eachOfSeries",args:[[10],[300],[1e4]],setup:function(n){tasks=_.range(n)},fn:function(n,e){n.eachOfSeries(tasks,function(e,t,s){n.setImmediate(s)},e)}},{name:"eachOfLimit",args:[[10],[300],[1e4]],setup:function(n){tasks=_.range(n)},fn:function(n,e){n.eachOfLimit(tasks,4,function(e,t,s){n.setImmediate(s)},e)}},{name:"parallel",args:[[10],[100],[1e3]],setup:function(n){tasks=_.range(n).map(function(){return function(n){setImmediate(n)}})},fn:function(n,e){n.parallel(tasks,e)}},{name:"series",args:[[10],[100],[1e3]],setup:function(n){tasks=_.range(n).map(function(){return function(n){setImmediate(n)}})},fn:function(n,e){n.series(tasks,e)}},{name:"waterfall",args:[[10],[100],[1e3]],setup:function(n){tasks=[function(n){return n(null,1)}].concat(_.range(n).map(function(n){return function(e,t){setImmediate(function(){t(null,n)})}}))},fn:function(n,e){n.waterfall(tasks,e)}},{name:"queue",args:[[1e3],[3e4],[1e5],[2e5]],setup:function(n){tasks=n},fn:function(n,e){function t(n,t){return n.num===s?e():void setImmediate(t)}for(var s=tasks,a=n.queue(t,1),i=1;i<=s;i++)a.push({num:i})}},{name:"some - no short circuit- false",args:[[500]],setup:function(n){tasks=_.range(n)},fn:function(n,e){n.some(tasks,function(e,t){n.setImmediate(function(){t(e>=600)})},e)}},{name:"some - short circuit - true",args:[[500]],setup:function(n){tasks=_.range(n)},fn:function(n,e){n.some(tasks,function(e,t){n.setImmediate(function(){t(e>=60)})},e)}},{name:"every - no short circuit- true",args:[[500]],setup:function(n){tasks=_.range(n)},fn:function(n,e){n.every(tasks,function(e,t){n.setImmediate(function(){t(e<=600)})},e)}},{name:"every - short circuit - false",args:[[500]],setup:function(n){tasks=_.range(n)},fn:function(n,e){n.every(tasks,function(e,t){n.setImmediate(function(){t(e<=60)})},e)}},{name:"defer nextTick",fn:function(n,e){process.nextTick(e)}},{name:"defer setImmediate",fn:function(n,e){setImmediate(e)}},{name:"defer async.nextTick",fn:function(n,e){n.nextTick(e)}},{name:"defer async.setImmediate",fn:function(n,e){n.setImmediate(e)}},{name:"defer setTimeout",fn:function(n,e){setTimeout(e,0)}},{name:"ensureAsync sync",fn:function(n,e){n.ensureAsync(function(n){n()})(e)}},{name:"ensureAsync async",fn:function(n,e){n.ensureAsync(function(n){setImmediate(n)})(e)}},{name:"ensureAsync async noWrap",fn:function(n,e){!function(n){setImmediate(n)}(e)}}];