Re: [whatwg/streams] Performance optimization: `ReadableStreamDefaultReader.prototype.readMany` (Issue #1236)

I've been considering the possibility of a new kind of reader that implements the `Body` mixin, which would provide opportunities for these kinds of optimizations. e.g.

```js
const readable = new ReadableStream({ ... });

const reader = new ReadableStreamBodyReader(readable);

await reader.arrayBuffer();

// or

await reader.blob();

// or

await reader.text();
```

The `ReadableStreamBodyReader` would provide opportunities to more efficiently consume the `ReadableStream` without going through the typical chunk-by-chunk slow path and would not require any changes to the existing standard API surface.

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

Message ID: <whatwg/streams/issues/1236/1155226720@github.com>

Received on Tuesday, 14 June 2022 14:00:50 UTC