Re: [whatwg/streams] Brainstorming a buffer-reusing version of writable streams (#495)

> XORing would still be reading and writing every byte, wouldn't it?

Ah, yeah. I was thinking about benefit of:
- (1) no-copy between different memory regions
- (2) no extra allocation of memory

But yeah, what ricea was saying was about use case without any read/write operation. My bad.

So, the XOR example is about usefulness of being able to pass through a given buffer. We can realize this even with the normal non-byob read()/write() (the buffer given to write() is read from write()). The beginWrite / getBufferWriter enables this also for BYOB reader.

Maybe only (2) is the gain. Even when we use SIMD instruction, (1) wouldn't be so big given the encrypt example would be sequential operation where operation on the same region or two regions wouldn't make so much difference in memory locality.

-- 
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/495#issuecomment-256960927

Received on Friday, 28 October 2016 16:07:01 UTC