Node Worker Threads With Async Parallel

worker_threads is a new feature of Node 11, allowing multithreaded operations with Node. Especially useful for CPU intensive workloads where you wish to make use of a multicore machine.

async is a module for Node which helps provide a framework for various async operations in Node. It can provide speedups for IO (disk, network) intensive workloads, but since it still only runs on a single thread doesn’t help much for CPU intensive workloads.

Using async/parallel

Lets have a look at how we’d traditionally run parallel tasks with async: