Re: [whatwg/streams] Could a byte stream read directly into and out of a SAB (w/o transfer)? (#757)

I think the root cause here is not that promises are slow per se, but rather that there are too many of them.  If we switch to callbacks, we will probably just run into the problem of the callback being called too often.

I am actually not sure I understand the proposal here.  I can see two things we can do with SABs:

1. Let the application provide the browser with its SAB, and let the browser write into said SAB.  This is roughly like BYOB in terms of performance, but can be used without detaching the buffer.
1. Let the browser return views into some shared buffer as the output of the stream.  This would enable potential zero-copy access to stream data, since the views could point to whatever internal structure the browser uses to store that data in first place.

The description in the issue seems to indicate that (1) is proposed, but the `mmap` idea seems to imply (2), since I don't think that would work with (1).

-- 
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/757#issuecomment-507764913

Received on Tuesday, 2 July 2019 17:07:49 UTC