Repository navigation
Slow read from blob stream #42108
Copy link
Copy link
Closed
Labels
bufferIssues and PRs related to the buffer subsystem.Issues and PRs related to the buffer subsystem.web streamsIssues and PRs related to the Web Streams API.Issues and PRs related to the Web Streams API.
Description
Activity
I looked up what's happening behind the scenes:
Lines 323 to 339 in 9be1dcf
return new lazyReadableStream({ async start() { this[kState] = await self.arrayBuffer(); }, pull(controller) { if (this[kState].byteLength <= kMaxChunkSize) { controller.enqueue(new Uint8Array(this[kState])); controller.close(); this[kState] = undefined; } else { const slice = this[kState].slice(0, kMaxChunkSize); this[kState] = this[kState].slice(kMaxChunkSize); controller.enqueue(new Uint8Array(slice)); } } }); - addedbufferIssues and PRs related to the buffer subsystem.Issues and PRs related to the buffer subsystem.streamIssues and PRs related to Node.js streams.Issues and PRs related to Node.js streams.
on Feb 24, 2022 - addedweb streamsIssues and PRs related to the Web Streams API.Issues and PRs related to the Web Streams API.and removedstreamIssues and PRs related to Node.js streams.Issues and PRs related to Node.js streams.
on Feb 24, 2022 - added a commit that references this issue
on Feb 24, 2022 - added a commit that references this issue
on Feb 27, 2022 - added a commit that references this issue
on Mar 7, 2022 - added 4 commits that reference this issue
on Apr 21, 2022 - added a commit that references this issue
on Apr 25, 2022
Metadata
Metadata
Assignees
Labels
bufferIssues and PRs related to the buffer subsystem.Issues and PRs related to the buffer subsystem.web streamsIssues and PRs related to the Web Streams API.Issues and PRs related to the Web Streams API.
Version
16.14.0
Platform
Darwin Alans-MacBook-Pro.local 21.1.0 Darwin Kernel Version 21.1.0: Wed Oct 13 17:33:01 PDT 2021; root:xnu-8019.41.5~1/RELEASE_ARM64_T6000 arm64
Subsystem
No response
What steps will reproduce the bug?
Output:
How often does it reproduce? Is there a required condition?
No response
What is the expected behavior?
No response
What do you see instead?
Why does it take 203ms to read 65kb from an in memory buffer?
blob.slice(0, 65536)takes0.148msso maybe some copying is happening?Takes
105ms, which is still half the timestream.read()takes.Additional information
No response