The Wire · Showcase
UNDICI FIXES H2 MULTIPLEXING BOTTLENECK, NODE EVENTS LAYER CUTS MEMORY BLOAT
By RepoJournal · Filed · About Node.js
Undici's HTTP/2 client can finally multiplex stream-bodied requests without waiting for other in-flight traffic to drain, fixing a critical performance regression that forced sequential request handling.
The fix [1] removes the artificial serialization that deferred any request with a stream, async-iterable, or FormData body until every other request on the H2 session completed. If one of those in-flight requests is long-lived (like a streaming download), downstream requests got stuck in queue. This lands alongside two companion fixes: synchronous stream destruction on abort [3] instead of deferred cleanup, and proper header removal on POST-to-GET redirects [2]. On the Node.js core side, the events layer got aggressive optimization [5] that cuts memory growth when event names are unstructured or frequently removed [4]. The EventEmitter hot path gains 25% throughput on once(), 12-22% on add-remove operations, and 7-15% on listen-unique workloads. Matteo Collina landed these alongside libffi 3.7.1 [6] and new conditional probe support in the inspector [7]. Doc-kit shipped 1.4.2 [8] with formalized changesets-driven releases.
Action items
- → Upgrade undici if you stream request bodies over HTTP/2; this restores concurrent multiplexing nodejs/undici [plan]
- → Update Node.js core when available; EventEmitter optimization benefits all long-lived processes nodejs/node [monitor]
References
- [1] fix(h2): allow stream-bodied requests to multiplex on a busy session ↗ nodejs/undici
- [2] fix(redirect): remove body headers after POST-to-GET (#5551) nodejs/undici
- [3] fix(h2): destroy aborted stream synchronously instead of via setImmediate (#5559) nodejs/undici
- [4] events: avoid retaining removed event names nodejs/node
- [5] events: optimize once() and removeListener() ↗ nodejs/node
- [6] deps: update libffi to 3.7.1 ↗ nodejs/node
- [7] inspector: add --cond to node inspect probe mode ↗ nodejs/node
- [8] v1.4.2 ↗ nodejs/doc-kit