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

core: compute TBT impact for main thread tasks #15175

Merged
merged 26 commits into from
Jul 5, 2023
Merged

Conversation

adamraine
Copy link
Member

@adamraine adamraine commented Jun 14, 2023

As mentioned here, some long tasks that appear in the trace are not added to TBT because they are outside the bounds of TBT (Starting at FCP and ending at TTI).

This PR adds a computed artifact to calculate the impact each individual main thread task has on TBT. A downstream performance audit will use this to calculate the TBT savings for main thread tasks that are in scope for that audit. I expect to use this to calculate TBT savings in the following audits:

  • bootup-time
  • dom-size
  • third-party-facades
  • third-party-summary

@@ -60,7 +60,7 @@ class TotalBlockingTime extends ComputedMetric {
timing: calculateSumOfBlockingTime(
events,
0,
data.processedTrace.timestamps.traceEnd
data.processedTrace.timings.traceEnd
Copy link
Member Author

Choose a reason for hiding this comment

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

Pretty sure this is a bug, but doesn't affect anything in practice. Timespan should just calculate the blocking time for the entire trace anyway.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@adamraine adamraine changed the title WIP: compute TBT impact for main thread tasks core: compute TBT impact for main thread tasks Jun 29, 2023
@adamraine adamraine marked this pull request as ready for review June 29, 2023 15:19
@adamraine adamraine requested a review from a team as a code owner June 29, 2023 15:19
@adamraine adamraine requested review from brendankenny and removed request for a team June 29, 2023 15:20
@@ -41,7 +41,6 @@
"core/test/config/config-plugin-test.js",
"core/test/legacy/config/config-test.js",
"core/test/config/default-config-test.js",
"core/test/create-test-trace.js",
Copy link
Member Author

Choose a reason for hiding this comment

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

Type checking the new test file requires this to be type checked as well, so there are some changes to artifacts.d.ts and create-test-trace.js so it passes the type check.

@adamraine adamraine merged commit 9e2f70e into main Jul 5, 2023
@adamraine adamraine deleted the tbt-impact-tasks branch July 5, 2023 21:24
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.

None yet

2 participants