- From: Mattias Buelens <notifications@github.com>
- Date: Sun, 25 Jul 2021 03:57:13 -0700
- To: whatwg/streams <streams@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Sunday, 25 July 2021 10:57:26 UTC
I've been thinking about whether we want to expose `pullIntoDescriptor.[[readFully]]` to the underlying byte source, e.g. something like `ReadableStreamBYOBRequest.isReadFullyRequest`. * Pro: the underlying byte source might be able to optimize for large reads, instead of receiving repeated `pull()` calls with continuations of the same BYOB request. For example, for `ReadableByteStreamTee`, we could forward a `readFully()` request from the branch all the way to the original stream. * Con: we might end up with *too much* buffering. Again using the `ReadableByteStreamTee` example: if the first branch does `readFully(new Uint8Array(1024))` and then the second branch does `read(new Uint8Array(1))`, the second branch wouldn't receive any data until the underlying source of the original stream has filled up the entire view of the forwarded `readFully()` request from the first branch. (This case probably deserves its own WPT test... 🤔) So yeah, it might be an optimization opportunity, but it might also be a footgun. At least for now, I'll leave `ReadableStreamBYOBRequest` untouched. 🙂 -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/whatwg/streams/pull/1145#issuecomment-886183342
Received on Sunday, 25 July 2021 10:57:26 UTC