Closed shaseley closed 3 weeks ago
Thanks for doing this work. We see three general threads to this work, each of which are at a different stage, but all of which are worthwhile.
The work around basic task scheduling APIs, (yield
and wait
or whatever those end up being called). This is good stuff. We'd encourage you to take this to WHATWG and get that into their process now. Aside from maybe that open naming issue, it is pretty solid.
The work around render
and requestAnimationFrame
, which deals with how the event loop interacts with the rendering process. That seems less well formed, but still quite important, perhaps even more important than the first item. Having a firm understanding of that interaction and clear means of controlling it would be a significant contribution to stability and performance of sites. We'd encourage you to continue that work to understand that. Please, don't feel constrained by how requestAnimationFrame
is; if there are ways in which that could be improved and integrated into a more comprehensive scheduling system, that would be excellent.
A general set of hooks that other APIs might use for scheduling work on the main event loop. To give an analogy, Fetch has an API for fetching stuff, but it also has a bunch of hooks that any other API can use if they need to obtain connections or resources. That's a useful contribution here also. For message channels or Fetch or WebRTC or whatever, the ability to schedule and prioritize work will be very useful. That aspect too needs work, but that can be taken to WHATWG also.
こんにちは TAG-さん!
I'm requesting a TAG review of Prioritized Task Scheduling (big picture).
Scheduling is an important tool for improving website performance and user experience, particularly on interactive pages with a lot of JavaScript. Two important aspects of this are:
The proposal consists of:
scheduler.postTask()
,scheduler.yield()
,TaskController
, andTaskSignal
. Other APIs in the explainer are at earlier stages of thought/design).Further details:
You should also know that...
This review request is in response to a request for a "bigger picture" Scheduling APIs explainer (cc: @hober @plinss), and there is overlap with
scheduler.yield()
's specification review in https://github.com/w3ctag/design-reviews/issues/966. Some of the work here (TaskController
,TaskSignal
(except.any()
), andscheduler.postTask()
) was reviewed in https://github.com/w3ctag/design-reviews/issues/647.