SYSTEM Cited by 1 source
LiteReadable¶
LiteReadable is Vercel's custom array-based buffer
replacement for Node.js's built-in
Readable, used inside
fast-webstreams to back
byte-oriented ReadableStream({type: 'bytes'}) instances.
Disclosed 2026-04-21 in
sources/2026-04-21-vercel-we-ralph-wiggumed-webstreams-to-make-them-10x-faster.
Why it exists¶
Node's Readable is a full-featured, EventEmitter-based,
internally-queued stream class. For the specific
React Flight byte-stream
pattern — new ReadableStream({type: 'bytes'}) with
start() capturing the controller and external
controller.enqueue(Uint8Array) calls — most of Node
Readable's machinery is unused while its per-construction
overhead is measurable.
React Flight creates hundreds of byte streams per request. A ~5 µs saving per construction compounds.
Design¶
- Array-based buffer, not a ring buffer or linked list.
- Direct callback dispatch, not EventEmitter. Avoids
the
on/emitcost per data event. - Pull-based demand, so the buffer fills when asked, not ahead of consumption.
- BYOB (bring-your-own-buffer) reader support — see
concepts/byob-reads. Consumers pass in a pre-allocated
ArrayBufferview; data is copied once into consumer memory, not into an intermediate buffer first. - ~5 µs less per construction vs Node's
Readable, per the 2026-04-21 post.
Measured impact¶
On the React Flight pattern (start + enqueue), native
Web Streams throughput is ~110 MB/s at 1 KB chunks;
fast-webstreams with LiteReadable hits ~1,600 MB/s —
a 14.6× gap. Per the post: "it costs about 5
microseconds less per construction. That matters when
React Flight creates hundreds of byte streams per
request."
Not a standalone library¶
LiteReadable is an internal component of
fast-webstreams, not a
public export or replacement for stream.Readable in
general. The design is specifically tuned to the
byte-stream + enqueue-externally pattern. General-purpose
Node Readable use cases (object mode, backpressure-heavy
pipes, pause/resume semantics) are left to the built-in
stream.Readable.
Seen in¶
- sources/2026-04-21-vercel-we-ralph-wiggumed-webstreams-to-make-them-10x-faster — canonical disclosure as the byte-stream fast path inside fast-webstreams; ~5 µs per-construction gain; 14.6× on the React Flight pattern.
Related¶
- systems/fast-webstreams — the parent library.
- systems/nodejs — the runtime whose
ReadableLiteReadable narrowly replaces. - systems/react-flight — the workload with hundreds of byte streams per request.
- concepts/promise-allocation-overhead — the parent cost class construction overhead is part of.
- concepts/synchronous-fast-path-streaming — the sibling optimisation on reads.
- concepts/byob-reads — the zero-copy reader protocol LiteReadable supports.