Open Bug 1388050 Opened 7 years ago Updated 2 years ago

optimize consuming a ReadableStream with js "bytes" source


(Core :: DOM: Core & HTML, enhancement, P3)





(Reporter: bkelly, Unassigned)


(Blocks 2 open bugs)


The streams spec allows js to specify that the underlying source of a ReadableStream has the type "bytes".  In this case the stream detaches the ArrayBuffer when it is read by the stream.

We should add an optimization path for native code consuming fetch body streams that have a js byte source.  This would let us essentially "steal" the underlying Uint8Array and just store it in an nsIInputStream internally.  This would avoid the need to copy from the Uint8Array to our nsPipe.

Note, chrome does not implement byte streams yet.  So for right now this is a nice-to-have, but we should not block on it.
Priority: -- → P3
Component: DOM → DOM: Core & HTML
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.