Fix BodyStream to support actual Bring-Your-Own-Buffer(BYOB)
Categories
(Core :: DOM: Networking, enhancement, P2)
Tracking
()
People
(Reporter: saschanaz, Assigned: saschanaz)
References
(Blocks 1 open bug, )
Details
(Whiteboard: [necko-triaged])
Attachments
(2 files)
Currently BodyStream just enqueues things by creating a new Uint8Array: https://searchfox.org/mozilla-central/rev/7426a35738cd542b9488c7b67f4f6d21edfeda0a/dom/base/BodyStream.cpp#435
Instead, it should write into [[byobRequest]]
view when available to reduce copy. The behavior won't be web-visible, it's more for better performance by skipping copy into a new Uint8Array and then again into byob buffer.
Updated•2 years ago
|
Assignee | ||
Updated•2 years ago
|
Assignee | ||
Comment 1•2 years ago
|
||
Updated•2 years ago
|
Assignee | ||
Comment 2•2 years ago
•
|
||
(Preparing release note request early)
Release Note Request (optional, but appreciated)
[Why is this notable]: It provides more performant way when reading stream from Fetch and WebTransport
[Affects Firefox for Android]: Yes
[Suggested wording]: This release now supports proper BYOB readers on Fetch and WebTransport, which allows devs to prepare their ArrayBuffer so that it can be reused for read requests and thus saves memory allocation. .getReader({ mode: "byob" })
on Fetch and WebTransport streams was supported on previous releases but without true BYOB support as new memory allocation still occurred internally.
[Links (documentation, blog post, etc)]: (None)
Updated•2 years ago
|
Updated•2 years ago
|
Assignee | ||
Comment 3•2 years ago
|
||
... instead of handling it within itself, which makes the error handling story complex.
Updated•2 years ago
|
Comment 5•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/d61e3f16a3fa
https://hg.mozilla.org/mozilla-central/rev/d3f82b964829
Comment 6•2 years ago
|
||
Added to 116 nightly release notes https://www.mozilla.org/en-US/firefox/116.0a1/releasenotes/
Updated•2 years ago
|
Description
•