-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
stream: augment BufferList.prototype #18353
Conversation
Move functions that deal with `BufferList` to `BufferList.prototype`.
Not sure where the 4% improvement of streams/writable-manywrites.js comes from since this doesn't touch writable. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but can we either hide _getString
& _getBuffer
behind a symbol or make them helper functions (that accept the class instance as first argument)? I don't want to accidentally end up in a universe where someone starts using those methods and we have to support them.
(I would almost lean towards them being helper functions since there's only one place they're used.)
@apapirovski I didn't use symbols because that is an internal module. |
@lpinca The problem is that we can access BufferList instances via stream internals which are exposed, right? (I'm not saying it's smart to do so but I would just prefer to even not have a chance of ending up in that situation. That said, if no one else cares then I'm fine with this staying as is – hence my approval.) |
Yes but by that logic all |
@lpinca true enough. 👍 It was probably the (To be clear: I'm fine with this remaining as is. You're completely right.) |
Landed in ccf64e5 |
Move functions that deal with `BufferList` to `BufferList.prototype`. PR-URL: nodejs#18353 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Should this be backported to |
Move functions that deal with `BufferList` to `BufferList.prototype`. PR-URL: nodejs#18353 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Move functions that deal with `BufferList` to `BufferList.prototype`. PR-URL: nodejs#18353 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
For SoC/readability and to facilitate refactoring if the
BufferList
underlying data structure is changed.Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
stream