[DRAFT] stream: prototype for new stream implementation#62066
Draft
jasnell wants to merge 1 commit intonodejs:mainfrom
Draft
[DRAFT] stream: prototype for new stream implementation#62066jasnell wants to merge 1 commit intonodejs:mainfrom
jasnell wants to merge 1 commit intonodejs:mainfrom
Conversation
Collaborator
|
Review requested:
|
bjohansebas
reviewed
Mar 1, 2026
ronag
approved these changes
Mar 2, 2026
Member
ronag
left a comment
There was a problem hiding this comment.
Super impressed! This is amazing.
One note. Since this is supposed to be "web compatible" it looks to me like everything is based on Uint8Array which is a bit unfortunate for Node. Could the node implementation use Buffer it would still be compatible it's just that we can access the Buffer prototype methods without doing hacks like Buffer.prototype.write.call(...).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Opening this for discussion. Not intending to land this yet. It adds an implementation of the "new streams" to core and adds support to
FileHandlewith tests and benchmarks just to explore implementation feasibility, performance, etc.It's worth noting that the performance of the
FileHandlebenchmarked added, that reads files, converts them to upper case and then compresses them, is on par with node.js streams and twice as fast as web streams. (tho... web streams are not perf optimized in any way so take that 2x with a grain of salt). The majority of the perf cost in the benchmark is due to compression overhead. Without the compression transform, the new stream can be up to 15% faster than reading the file with classic node.js streams.The main thing this shows is that the new streams impl can (a) perform reasonably and (b) sit comfortably alongside the existing impls without any backwards compat concerns.
Benchmark runs: