Skip to content
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

Take into account scheduler.yield() #16183

Open
connorjclark opened this issue Sep 9, 2024 · 1 comment
Open

Take into account scheduler.yield() #16183

connorjclark opened this issue Sep 9, 2024 · 1 comment
Assignees
Labels

Comments

@connorjclark
Copy link
Collaborator

scheduler.yield() is here.

AFAIU, this is a better version of navigator.scheduling.isInputPending() (which LH also does not handle #11747).

We can handle this pretty simply, I think:

  1. Emit a trace event when await scheduler.yield() happens
  2. When simulating long tasks for mobile, use these trace events as the bounds for "synthetic" tasks, and check if those are larger than the long task threshold rather than the original-task-multiplied-by-cpu-throttling

This should fairly reduce TBT for pages that properly use scheduler.yield.

We may wish to prioritize this in order to give people trying this new feature out in Origin Trials, and using Lighthouse to help evaluate its impact, will get a good representation of its effectiveness.

@brendankenny
Copy link
Member

people trying this new feature out in Origin Trials

FYI the origin trial is over and scheduler.yield is shipping in m129 (currently in beta).

Plan seems workable for tasks as LH has defined them, though more difficult in an animation-frame-based future. OTOH might not matter as much by then since it only matters for simulated throttling.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants