Ready for Trial: scheduler.yield()

Skip to first unread message

Scott Haseley

Apr 5, 2023, 4:07:33 PM4/5/23
to blink-dev

Contact emails





Provides a method for yielding control to the browser, which can be used to break up long tasks. Awaiting the promise returned by scheduler.yield() causes the current task to yield, continuing in a new browser task. This can be used to improve responsiveness issues caused by long tasks. Continuations are prioritized to mitigate performance problems of existing alternatives.

Blink component


TAG review

Early design review:

TAG review status



Interoperability and Compatibility

This is a new feature and will not change existing event loop task scheduling, so the main risk is that other browsers might not implement the feature. There is an interop challenge, however, that comes with prioritization: we want to be specific enough to provide developers guarantees and interoperable implementations, but provide enough scheduling flexibility for UAs (like the HTML specification does with task sources/task queues), which we'll keep in mind while drafting the spec (see also

Gecko: No signal

WebKit: No signal

Web developers: No signals

Other signals:


The default use (inserting yield points in long tasks) should enable Chrome to maintain better performance (responsiveness). There is a risk of continuations starving other work, but there are reasonable mitigations, e.g. bounding total of prioritized continuations (see also This is something we'll be looking for in origin trial feedback.


The feature would benefit from a polyfill so that tasks still yield in the case the feature is unavailable. The behavior can be approximated by awaiting `scheduler.postTask()` or wrapping `setTimeout(0)` in a promise. The signal inheritance bit [1], however, would need transpilation support to propagate the current signal across async (Promise) boundaries. But developers can alternatively pass the appropriate priority/signal if necessary on browsers that don't support the feature.




WebView application risks

Does this intent deprecate or change behavior of existing APIs, such that it has potentially high risk for Android WebView-based applications?


Goals for experimentation

Ongoing technical constraints



This has basic new-API devtools support. We plan to work with the devtools team to see if we can integrate continuations into the performance panel in some way.

Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?


Is this feature fully tested by web-platform-tests?

Yes (

DevTrial instructions

Flag name


Requires code in //chrome?


Tracking bug

Estimated milestones

DevTrial on desktop113
DevTrial on Android113

Link to entry on the Chrome Platform Status

Links to previous Intent discussions

Intent to prototype:

This intent message was generated by Chrome Platform Status.
Reply all
Reply to author
0 new messages