-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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: buffer-list encapsulation #28974
Conversation
b33fec8
to
324b965
Compare
lib/_stream_readable.js
Outdated
while (p !== null) { | ||
content += decoder.write(p.data); | ||
p = p.next; | ||
for (const data of this._readableState.buffer) { |
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.
Is this as fast as the original loop?
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.
I don't know... trying to figure out the whole benchmark thing at the moment
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.
streams/readable-readall.js n=200 0.67 % ±3.32% ±4.42% ±5.77%
7497bf0
to
2a729ce
Compare
@nodejs/streams |
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.
Would you mind adding a unit test of the iterator in test-stream-buffer-list.js?
test updated |
2a729ce
to
957f403
Compare
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
957f403
to
4885e6e
Compare
needed a master rebase + |
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
PR-URL: nodejs#28974 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Landed in c15b496 |
PR-URL: #28974 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Is this intended to be used in place of something like bl? |
Not really, BufferList is not really documented API. |
Only use public API on buffer list to improve encapsulation and make it easier to experiment with alternative implementations.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes