Node Underground
Node Underground
Aug 1, 2021 · Backend Development

How to Efficiently Handle CPU‑Intensive Tasks in Node.js

This article explains what CPU‑bound tasks are, why Node.js struggles with them, and presents three practical solutions—splitting work with setImmediate, offloading to child processes, and leveraging worker_threads—illustrated with a Fibonacci calculation example and complete code snippets.

CPU-intensiveNode.jschild_process
0 likes · 5 min read
How to Efficiently Handle CPU‑Intensive Tasks in Node.js
Node Underground
Node Underground
Jan 25, 2018 · Backend Development

Mastering Node.js child_process: exec vs spawn and Multi‑Core Strategies

Node.js’s child_process core module enables creation of child processes to leverage multi‑core CPUs and inter‑process communication, while also allowing execution of external files or system commands; this article explores the differences and inner workings of its exec and spawn methods.

Node.jsProcess Managementchild_process
0 likes · 1 min read
Mastering Node.js child_process: exec vs spawn and Multi‑Core Strategies