core(metrics): handle scheduler.yield#17066
Draft
connorjclark wants to merge 3 commits into
Draft
Conversation
…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
connorjclark
commented
Jun 5, 2026
| <!DOCTYPE html> | ||
| <!-- | ||
| * @license | ||
| * Copyright 2024 Google LLC |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
(draft: AI assisted, I haven't done due diligence yet)
fixes #16183