Re: [whatwg/streams] ReadableStreamBYOBReader.prototype.readFully(view) (#1143)

https://github.com/whatwg/streams/issues/1175 might be an API that's more easily optimized by implementations while offering the same semantics if needed. The reason is that you may want to allocate 1 large buffer & read as much from the kernel in one shot as you can with subsequent reads to fill up to the minimum amount. If you do the `readFully`, then unless the underlying kernel reads align perfectly, you'll end up issuing slightly more syscalls than needed. Probably not a material difference either way, but `readFully` could simply be a convenience wrapper for `readAtLeast(buffer.length, buffer)` (if the wrapper makes sense separately for ergonomic reasons).

-- 
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/issues/1143#issuecomment-942713186

Received on Wednesday, 13 October 2021 20:55:53 UTC