Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

ronag
Copy link
Member

@ronag ronag commented Aug 5, 2019

Only use public API on buffer list to improve encapsulation and make it easier to experiment with alternative implementations.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

@nodejs-github-bot nodejs-github-bot added the stream Issues and PRs related to the stream subsystem. label Aug 5, 2019
@ronag ronag force-pushed the stream-buffer-list branch 6 times, most recently from b33fec8 to 324b965 Compare August 5, 2019 11:32
@addaleax addaleax added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Aug 5, 2019
@nodejs-github-bot
Copy link
Collaborator

while (p !== null) {
content += decoder.write(p.data);
p = p.next;
for (const data of this._readableState.buffer) {
Copy link
Member

@lpinca lpinca Aug 5, 2019

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?

Copy link
Member Author

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

Copy link
Member Author

@ronag ronag Aug 5, 2019

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%

@ronag ronag force-pushed the stream-buffer-list branch 3 times, most recently from 7497bf0 to 2a729ce Compare August 6, 2019 09:13
@ronag ronag mentioned this pull request Aug 6, 2019
2 tasks
@Trott
Copy link
Member

Trott commented Aug 8, 2019

@nodejs/streams

Copy link
Member

@mcollina mcollina left a 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?

@ronag
Copy link
Member Author

ronag commented Aug 9, 2019

test updated

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@nodejs-github-bot
Copy link
Collaborator

@ronag
Copy link
Member Author

ronag commented Aug 9, 2019

needed a master rebase + no-unused-vars

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nodejs-github-bot
Copy link
Collaborator

Trott pushed a commit to Trott/io.js that referenced this pull request Aug 9, 2019
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>
@Trott
Copy link
Member

Trott commented Aug 9, 2019

Landed in c15b496

@Trott Trott closed this Aug 9, 2019
targos pushed a commit that referenced this pull request Aug 19, 2019
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>
@dave-kennedy
Copy link

Is this intended to be used in place of something like bl?

@mcollina
Copy link
Member

Not really, BufferList is not really documented API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. stream Issues and PRs related to the stream subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants