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(root-causes): grab from trace insights rather than use protocol #16352

Merged
merged 10 commits into from
Feb 24, 2025

Conversation

connorjclark
Copy link
Collaborator

@connorjclark connorjclark commented Feb 24, 2025

This gatherer is one of the top CPU costs in PSI. Instead of using the protocol to gather root causes, lets just defer to the trace engine now that its there.

This regressed layout-shifts a bit:

  • No url for injected iframe root cause
  • No render blocking requests root cause

However, we're soon to drop that audit and replacing with an insight audit.

@connorjclark connorjclark requested a review from a team as a code owner February 24, 2025 19:54
@connorjclark connorjclark requested review from adamraine and removed request for a team February 24, 2025 19:54
Copy link
Member

@adamraine adamraine left a comment

Choose a reason for hiding this comment

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

No url for injected iframe root cause
No render blocking requests root cause

Losing render blocking requests as a root cause doesn't really bother me. It would be nice to have the iframe node id in the TE result somehow, but this PR is still an upgrade since iframe root causes were disabled before.

// {
// node: {selector: 'body > div#blue'},
// // TODO: We can't get nodes from non-main frames yet. See runRootCauseAnalysis.
// subItems: {items: [{cause: /iframe/, extra: undefined}]},
Copy link
Member

Choose a reason for hiding this comment

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

We should get an iframe root cause now. The iframe root causes were only disabled for the old root causes engine.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's not there. Keep in mind the implementations of these differ.

Copy link
Member

Choose a reason for hiding this comment

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

What implementation difference? If this isn't showing up then maybe we have a bug in the TE?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

i don't know. it'd be a lot of work to understand this and I think I can't prioritize looking into it.

#16354

/** @type {LH.Artifacts.TraceEngineRootCauses} */
const allRootCauses = {
layoutShifts: new Map(),
};
Copy link
Member

Choose a reason for hiding this comment

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

nit: can't we just do const layoutShifts = new Map()

@connorjclark connorjclark merged commit 73b54a9 into main Feb 24, 2025
27 checks passed
@connorjclark connorjclark deleted the root-causes-te branch February 24, 2025 22:35
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.

2 participants