-
-
Notifications
You must be signed in to change notification settings - Fork 38k
stream: suggestion stream._writeMany #29034
Copy link
Copy link
Closed
Labels
feature requestIssues requesting new Node.js features.Issues requesting new Node.js features.streamIssues and PRs related to Node.js streams.Issues and PRs related to Node.js streams.
Description
Activity
Metadata
Metadata
Assignees
Labels
feature requestIssues requesting new Node.js features.Issues requesting new Node.js features.streamIssues and PRs related to Node.js streams.Issues and PRs related to Node.js streams.
Currently the
stream.writevAPI has two drawbacks:allBuffers).It would be nice if user space could just create the correctly formatted array without having to perform any allocations, copies and transformations.
In order to not break anything I suggest a new signature
writevmaybe calledwriteMany?Which would look something like:
e.g.
Looking at the current
Writableimplementation, thewritevscenario will always create two "unnecessary" array copies in order to pass the chunks. Furthermore all the array entries are allocated objects.