Re: [whatwg/streams] ReadableStream.from(asyncIterable) (#1083)

It would be nice to know *where* we are losing time. Is it because we have to go through more microtasks? Would it be worth trying to optimize the `ReadableStream` machinery itself for cases where `startAlgorithm` and `pullAlgorithm` run *synchronously*? That is:
* In `SetUpReadableStreamDefaultController`, don't wrap `startResult` in a promise, but instead set `[[started]]` to true immediately.
* In `ReadableStreamDefaultControllerCallPullIfNeeded`, allow `[[pullAlgorithm]]` to return a non-promise (or just ignore its result altogether) and set `[[pulling]]` to false immediately after calling it.

Or is it not about the number of microtasks, and are we just running more code within each microtask? 🤔

-- 
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/1083#issuecomment-881315541

Received on Friday, 16 July 2021 09:38:41 UTC