-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prioritized Task Scheduling #361
Comments
Curious if there are other posts similar to https://medium.com/airbnb-engineering/building-a-faster-web-experience-with-the-posttask-scheduler-276b83454e91 about adoption of the API. In particular I think the point of splitting up "long tasks" is compelling, but has there been interest in the more granular API surface such as changing priorities of a task that is in-flight? And will that additional complexity actually lead to meaningful improvements in performance? (It will also increase the amount of script that needs to be written and transferred.) |
I don't know of any posts or articles discussing dynamic prioritization. It was something that came up with partners initially when designing the API, e.g. to dynamically reprioritize tasks during loading as the viewport changes (IIRC Datadog might be doing something like this). But usage of |
One other thing that came up when looking at this internally is that With |
I had thought the naming was consistent, since in each case you're waiting for a task to run after the associated action (the continuation always happens in a new task, not during the action):
We're open to renaming |
I discussed this some more with colleagues and the concern is that if you think of each of the names as describing what it waits for and what it does, they are not consistent:
You could possibly make these names more aligned by renaming render to waitForRender or yield to currentTask. What do you think? |
Thanks @annevk, I agree with your assessment. I'm still thinking about this -- I filed WICG/scheduling-apis#95 with some additional naming concerns that came up in discussions and to solicit wider feedback. I'm not opposed to |
WebKittens
@annevk @hober
Title of the spec
Prioritized Task Scheduling
URL to the spec
https://wicg.github.io/scheduling-apis/
URL to the spec's repository
https://github.com/wicg/scheduling-apis/
Issue Tracker URL
No response
Explainer URL
https://github.com/WICG/scheduling-apis/blob/main/explainers/prioritized-task-scheduling.md
TAG Design Review URL
w3ctag/design-reviews#967
Mozilla standards-positions issue URL
mozilla/standards-positions#1039
WebKit Bugzilla URL
No response
Radar URL
No response
Description
This proposal is for a suite of prioritized task scheduling APIs, which enable developers to break up and schedule work to improve user experience while having some control and influence over task ordering. The individual APIs in the linked explainer are in various stages of development.
For the APIs in the specification, which is the main focus of this request:
scheduler.postTask()
,TaskController
, andTaskSignal
:TaskSignal
has since been updated with a specialization ofAbortSignal.any()
, which is also included in the spec and explainerscheduler.yield()
The other ideas in the linked explainer — which build on the same primitives/ideas — are less fleshed out, but hopefully help to understand the broader picture. We've also filed a TAG design review for the overall Prioritized Task Scheduling work in w3ctag/design-reviews#967.
The text was updated successfully, but these errors were encountered: