adambom/parallel.js — pull request #87 by tcezeaux (2014-11-03 06:53:11+00:00)
Title: Reuse of workers to improve performance

I modified the map(), _spawnMapWorker(), reduce(), and _spawnReduceWorker() functions to re-use workers rather than terminating and recreating them for each iteration. This vastly improved performance for me. When a worker is finished, I pass it to the done() function to reuse if there are more iterations required.