Open fzaninotto opened 9 years ago
by limiting the maximum concurrency you can control both cpu and memory usage of the task
OK, so parallel is supposed to be slower than yield array by design, is that so?
co-parallel will be faster when the array you yield is too big so the node proc would reach its limits, and it will help to ensure not too many sockets are open at once etc.
what I don't like about this is that we have N * Array.length
functions to allocate instead of having a better co-each
, am I correct?
just to be more precise: yield* parallel(list, action, max)
Why is co-parallel better than simply yielding an array within co? I can't find any documentation about that, and my tests don't show any particular advantage:
This takes 170ms on average, while:
This takes 117ms on average