Re: [whatwg/streams] ReadableStream.prototype.arrayBuffer() (#1019)

I would guess that something like `Uint8Array.fromAsync` would be unlikely to be optimized well: that is, it would probably end actually allocating and reifying each chunk of bytes as a JS object. It's possible to optimize that away under some circumstances, but it would require special cases for each producer/consumer pair, and there's a lot of fiddly details which would need to get implemented. Whereas something like `ReadableStream.prototype.bytes()` could trivially avoid those intermediate allocations.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/streams/issues/1019#issuecomment-2017010828
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/streams/issues/1019/2017010828@github.com>

Received on Monday, 25 March 2024 00:25:38 UTC