Re: [streams] rsReader.readBatch(numberOfChunks)? rbsReader.read(view, { waitUntilDone: true })? (#320)

> Maybe a good way to cut out the noise here is to actually test callbacks + a loop (i.e., manually emulate the microtask queue) and compare that to sync read. Then we can see if an ideal fast microtask queue/promise implementation still introduces 7 ms of latency, or if it's just a Firefox-on-mobile optimization issue.

As far as I know, a callback async loop cannot be implemented without hitting timer 4ms clamping.  This is why developers want something like nextTick or setImmediate.  It seems the promise microtask is the solution.

Also, I believe Firefox has a reasonably fast microtask queue implementation.  Its almost certainly faster than something that puts the next event in the main event queue like setTimeout.

Finally, if you think this is a firefox issue, please help me fix the benchmark to run in chrome. :-)  Sorry I didn't have time to do this myself, but my time is shorter than usual this week due to travel.

> Angular has one, where once control returns to Angular code they run a while() loop of framework-specific tasks. We could do something similar.

I would be interested to see how we could construct this with the non-promise async primitives without triggering timer clamping in a an async loop.

---
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/streams/issues/320#issuecomment-91693875

Received on Friday, 10 April 2015 21:17:26 UTC