Compute-bound work keeps the main thread busy with expensive computation, limiting throughput and increasing response times. A hot function points to this bottleneck; event-loop delay can produce the same symptom for other reasons. section 11.3
In high-throughput streams, promise allocation and scheduling can add significant overhead to synchronous CPU work. That cost is generally less visible when each chunk waits on I/O. Keep synchronous work synchronous instead of routing it through a promise-based transform. section 10.4.5 section 10.7.1
Separate a CPU bottleneck from other causes of event-loop delay:
- A CPU bottleneck means expensive computation occupies the main thread; a profile shows a genuinely hot function. section 11.3
- Event-loop delay means tasks are waiting; long synchronous work, garbage-collection pauses, or microtask draining can contribute. section 11.3
// Web Streams
const transform = new TransformStream({
async transform(chunk, controller) {
const result = processChunk(chunk); // #A
controller.enqueue(result);
}
});Compare this promise-based Web Streams transform with the synchronous Node.js transform. section 10.7.1
const transform = new stream.Transform({
transform(chunk, encoding, callback) {
callback(null, processChunk(chunk));
}
});See the synchronous Node.js transform alternative. section 10.7.1








