-
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: use ByteLengthQueuingStrategy when not in object mode #48847
Conversation
2d2b9d0
to
a87605f
Compare
This would probably not be spec compliant, https://streams.spec.whatwg.org/#readable-stream-default-controller-should-call-pull I do not think we are allowed to add additional steps not mentioned in the spec |
ee2ce42
to
2d2672a
Compare
This comment was marked as resolved.
This comment was marked as resolved.
d6fcf75
to
74ada82
Compare
c5c66b4
to
81c3376
Compare
A previous PR had attempted the same, nonethless would cc @nodejs/whatwg-stream to take a look! |
Given that this is for our Node.js stream adapters, this change should be fine. |
|
||
assert(currentMemoryUsage <= 256 * 1024 * 1024); | ||
}; | ||
setInterval(reportMemoryUsage, 1000); |
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 wonder if this test could be somewhat flakey? too many timeouts but nonetheless shouldn't be a blocker
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
5b65e37
to
6cb8b2f
Compare
Landed in 261e88e |
Fixes: nodejs#46347 PR-URL: nodejs#48847 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Fixes: nodejs#46347 PR-URL: nodejs#48847 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
@CGQAQ Same issues with newWritableStreamFromStreamWritable ?https://github.com/CGQAQ/node/blob/885692a34f582c99d74430ba351879431738e43a/lib/internal/webstreams/adapters.js#L167 |
Use ByteLengthQueuingStrategy when not in object mode
After this PR
Array buffers memory usage is 0 MiB
Array buffers memory usage is 0 MiB
converting node stream to web stream
Array buffers memory usage is 0 MiB
Array buffers memory usage is 0 MiB
Array buffers memory usage is 0 MiB
Array buffers memory usage is 0 MiB
Array buffers memory usage is 0 MiB
Array buffers memory usage is 0 MiB
Array buffers memory usage is 0 MiB
reading the chunks
Array buffers memory usage is 2 MiB
Array buffers memory usage is 31 MiB
Array buffers memory usage is 9 MiB
Array buffers memory usage is 18 MiB
Array buffers memory usage is 9 MiB
Array buffers memory usage is 5 MiB
Array buffers memory usage is 8 MiB
Array buffers memory usage is 17 MiB
Array buffers memory usage is 13 MiB
Array buffers memory usage is 12 MiB
Array buffers memory usage is 19 MiB
Array buffers memory usage is 20 MiB
Array buffers memory usage is 31 MiB
Array buffers memory usage is 11 MiB
Array buffers memory usage is 24 MiB
Array buffers memory usage is 17 MiB
fixes: #46347