-
Notifications
You must be signed in to change notification settings - Fork 230
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Duplex seems to create unnecessary copies of Buffer data #162
Comments
@jamestalmage did you check if this is also the case for readable streams? |
there is no guarantee of buffer equality for streams not in object mode, the buffers can be combined and they can be split. If it's just the possible perf issues then we should look to see where the copy is happening. |
This does not happen with readable streams. My main concern here is the performance impact.
Just for my understanding: Why is that ever necessary in the base streams implementation? It seems to me that the goal would be to never copy data unnecessarily, and I am having a hard time thinking of a reason why a base stream implementation would ever need to. |
figured out the reason for this nodejs/node#3300 |
Oops! I obviously recalled incorrectly (probably got confused with my testing on node 12.X). Sorry. And thanks for the fix! |
fixed and is in both node and readable-streams |
The assertion below fails in
iojs >= 3.0.0
, andNode >= 4.0.0
. It passes in every earlier version I checked (0.8.28
to2.5.0
).It can be made to pass by setting
readableObjectMode: true
, but it is unclear to me why that would be necessary (or the implications it would have).The text was updated successfully, but these errors were encountered: