Tagged articles
4 articles
Page 1 of 1
Node Underground
Node Underground
Aug 15, 2022 · Backend Development

Boost Node.js Performance with Worker Threads: A Hands‑On Guide

Node.js runs JavaScript on a single thread, limiting CPU‑intensive tasks, but the worker‑threads module enables developers to spawn hidden threads, offload heavy computations, and prevent main‑thread blocking, with a practical example showing how to parallelize a CPU‑bound task across multiple workers.

CPU-intensiveNode.jsmultithreading
0 likes · 4 min read
Boost Node.js Performance with Worker Threads: A Hands‑On Guide
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
System Architect Go
System Architect Go
Sep 24, 2019 · Backend Development

Do CPU‑Intensive Tasks Block Node.js? An Experimental Study of libuv Thread Pool

An experiment demonstrates that CPU‑intensive encryption tasks do not block Node.js when the number of concurrent tasks does not exceed libuv’s default four‑thread pool, but adding a fifth task causes blocking, illustrating how libuv’s thread pool size and environment variable UV_THREADPOOL_SIZE affect concurrency.

CPU-intensiveNode.jsThread Pool
0 likes · 3 min read
Do CPU‑Intensive Tasks Block Node.js? An Experimental Study of libuv Thread Pool
Node Underground
Node Underground
Aug 31, 2019 · Backend Development

Mastering Node.js Worker Threads: Boost CPU‑Intensive Tasks

This article explains the architecture of Node.js, the limitations of its single‑threaded event loop for CPU‑heavy workloads, and how the experimental worker_threads module provides a multi‑threaded solution, including core concepts, APIs, best practices, and sample code to improve performance.

CPU-intensiveNode.jsWorker Threads
0 likes · 10 min read
Mastering Node.js Worker Threads: Boost CPU‑Intensive Tasks