Menu

We Ralph Wiggumed WebStreams to make them 10x faster
πŸ“°
0

We Ralph Wiggumed WebStreams to make them 10x faster

Vercel NewsΒ·Malte UblΒ·4 days ago
#CRKrlaU8
#vercel#chunk#node#fast#webstreams#promise
Reading 0:00
15s threshold

When we started profiling Next.js server rendering earlier this year, one thing kept showing up in the flamegraphs: WebStreams. Not the application code running inside them, but the streams themselves. The Promise chains, the per-chunk object allocations, the microtask queue hops. After Theo Browne's server rendering benchmarks highlighted how much compute time goes into framework overhead, we started looking at where that time actually goes. A lot of it was in streams. Turns out that WebStreams have an incredibly complete test suite , and that makes them a great candidate for doing an AI-based re-implementation in a purely test-driven and benchmark-driven fashion. This post is about the performance work we did, what we learned, and how this work is already making its way into Node.js itself through Matteo Collina's upstream PR . Link to heading The problem Node.js has two streaming APIs.…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More