-
-
Notifications
You must be signed in to change notification settings - Fork 35.6k
stream: suggestion stream._writeManyΒ #29034
Copy link
Copy link
Closed
Labels
feature requestIssues that request new features to be added to Node.js.Issues that request new features to be added to Node.js.streamIssues and PRs related to the stream subsystem.Issues and PRs related to the stream subsystem.
Metadata
Metadata
Assignees
Labels
feature requestIssues that request new features to be added to Node.js.Issues that request new features to be added to Node.js.streamIssues and PRs related to the stream subsystem.Issues and PRs related to the stream subsystem.
Type
Fields
Give feedbackNo fields configured for issues without a type.
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.