When creating 10000 small tasks I find that the process memory peeks around 170MB. When I run the same 10000 tasks with setImmediate it's doesn't go over 40MB.
So its seems that task group is generating an unusually large amount of memory overhead.
Here the code I was testing with.
var TaskGroup = require("taskgroup").TaskGroup;
var testArray = Array(10000).join().split(',');
var grp = TaskGroup.create();
testArray.forEach(function(value, index) {
grp.addTask(function() {
console.log("task"+index);
});
/*
setImmediate(function() {
console.log("task"+index);
});
*/
});
grp.run();
I only tested on Windows 8.1 so not sure what a Linux box will output
When creating 10000 small tasks I find that the process memory peeks around 170MB. When I run the same 10000 tasks with setImmediate it's doesn't go over 40MB.
So its seems that task group is generating an unusually large amount of memory overhead.
Here the code I was testing with.
I only tested on Windows 8.1 so not sure what a Linux box will output