Re: [w3ctag/design-reviews] Task Scheduling (#72)

So a few further thoughts here:
* anything that has callouts to script from within the rendering pipeline leads to the risk that we might have to repeat some of the core steps (e.g., style, layout) of the rendering pipeline within a single vsync / refresh tick
* we tend to want to put the things whose purpose is primarily to write (e.g., requestAnimationFrame) early in the process, and things whose purpose is primarily to read (e.g., IntersectionObserver) late in the pipeline.  When they're used the other way around, they can of course end up triggering repetition of steps.
* When we end up doing things that require repeating some of the steps, do we run these things more than once?  In most cases, probably not; we don't run the things that call out to script when there are layout or style flushes.  However, in cases where the later steps whose primary purpose was expected to be reading end up instead making writes, we've now run other read steps with data that's now bad.  Do we run them again?  What if they keep looping around?  (And how do they interact if there's more than one type of callout to script that we run again -- e.g., media query listeners on an iframe that poke style in their parent document and change the iframe's size, and say, an IntersectionObserver that does something similar?)  I wouldn't be surprised if there's some pretty poor interop here.


Another way of thinking about the input processing issue is this:  we want the rendering loop itself to be as small as possible so that we can get back to the event loop to do other things (e.g., processing input).  It's also nice to tie some of the input processing to the refresh loop so that we can batch it and avoid unnecessary processing (e.g., mouse movement or touch coalescing).  These two things seem to conflict a little bit, though maybe it's not a big deal.  (Is it well-defined when microtasks and nanotasks run in response to any event dispatch that's tied to the rendering loop, or to any other callouts to user script?)


But, really, this issue is waiting for somebody to do the work of understanding and testing this.

(Sorry, this comment might not be completely intelligible, but we need to move on to a scheduled discussion in the meeting now...)

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3ctag/design-reviews/issues/72#issuecomment-318099057

Received on Wednesday, 26 July 2017 15:59:19 UTC