Skip to content

core(metrics): handle scheduler.yield#17066

Draft
connorjclark wants to merge 3 commits into
mainfrom
scheduler-yield
Draft

core(metrics): handle scheduler.yield#17066
connorjclark wants to merge 3 commits into
mainfrom
scheduler-yield

Conversation

@connorjclark

Copy link
Copy Markdown
Collaborator

(draft: AI assisted, I haven't done due diligence yet)

fixes #16183

…ated TBT

Fixes massively inflated TBT and Javascript Execution Time metrics when pages
use scheduler.yield() or scheduler.postTask() for chunking work. When these
trace events are present, the tasks are bounded correctly, so we use their
original unthrottled duration to determine if they meet the 50ms long task
threshold rather than their simulated (cpu-throttled) duration.

Fixes #16183
Adds smoke tests to verify that scheduler.yield and scheduler.postTask
tasks are correctly simulated and do not artificially inflate Total
Blocking Time during mobile throttling.

Fixes #16183
… tasks

The original issue reported that both Total Blocking Time (TBT) and
JavaScript execution time were being artificially inflated during
simulated mobile throttling.

While the Total CPU Time math is technically correct across the whole page,
the simulated long tasks were appearing in the `long-tasks` audit table.
This commit ensures the `long-tasks` audit respects the original
unthrottled duration of tasks bounded by `scheduler.yield` or
`scheduler.postTask`, preventing them from falsely polluting the list
of input delay contributors.

Fixes #16183
<!DOCTYPE html>
<!--
* @license
* Copyright 2024 Google LLC

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Take into account scheduler.yield()

1 participant