-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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(byte-efficiency): replace pessimistic graph with optimistic #15651
Merged
Merged
Changes from 1 commit
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
3b3f4fb
replace pessimistic graph with optimistic
adrianaixba 43011b0
Merge branch 'main' into optimistic-byte-efficiency
adrianaixba 9c24cf9
use min of pessimistic and optimistic
adrianaixba 7787944
rely on the optimistic graph instead of taking the min
adrianaixba 3c710b0
fix
adrianaixba 24b39a7
note
adrianaixba a9464c3
nit
adrianaixba 200d672
Merge branch 'main' into optimistic-byte-efficiency
adrianaixba File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4457,7 +4457,7 @@ | |
"warnings": [], | ||
"metricSavings": { | ||
"FCP": 0, | ||
"LCP": 300 | ||
"LCP": 610 | ||
}, | ||
"details": { | ||
"type": "opportunity", | ||
|
@@ -4495,7 +4495,7 @@ | |
"type": "debugdata", | ||
"metricSavings": { | ||
"FCP": 0, | ||
"LCP": 300 | ||
"LCP": 610 | ||
} | ||
} | ||
}, | ||
|
@@ -4544,7 +4544,7 @@ | |
"displayValue": "Potential savings of 64 KiB", | ||
"metricSavings": { | ||
"FCP": 0, | ||
"LCP": 450 | ||
"LCP": 300 | ||
}, | ||
"details": { | ||
"type": "opportunity", | ||
|
@@ -4598,7 +4598,7 @@ | |
"type": "debugdata", | ||
"metricSavings": { | ||
"FCP": 0, | ||
"LCP": 450 | ||
"LCP": 300 | ||
} | ||
} | ||
}, | ||
|
@@ -4767,7 +4767,7 @@ | |
"displayValue": "Potential savings of 143 KiB", | ||
"metricSavings": { | ||
"FCP": 150, | ||
"LCP": 750 | ||
"LCP": 1060 | ||
}, | ||
"details": { | ||
"type": "opportunity", | ||
|
@@ -4809,7 +4809,7 @@ | |
"type": "debugdata", | ||
"metricSavings": { | ||
"FCP": 150, | ||
"LCP": 750 | ||
"LCP": 1060 | ||
} | ||
} | ||
}, | ||
|
@@ -4851,14 +4851,14 @@ | |
"id": "efficient-animated-content", | ||
"title": "Use video formats for animated content", | ||
"description": "Large GIFs are inefficient for delivering animated content. Consider using MPEG4/WebM videos for animations and PNG/WebP for static images instead of GIF to save network bytes. [Learn more about efficient video formats](https://developer.chrome.com/docs/lighthouse/performance/efficient-animated-content/)", | ||
"score": 0, | ||
"score": 0.5, | ||
"scoreDisplayMode": "metricSavings", | ||
"numericValue": 3450, | ||
"numericUnit": "millisecond", | ||
"displayValue": "Potential savings of 666 KiB", | ||
"metricSavings": { | ||
"FCP": 0, | ||
"LCP": 3300 | ||
"LCP": 0 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a good change. Byte savings on the large gif are good, but it isn't the LCP resource so it's LCP impact is superficial. |
||
}, | ||
"details": { | ||
"type": "opportunity", | ||
|
@@ -4895,7 +4895,7 @@ | |
"type": "debugdata", | ||
"metricSavings": { | ||
"FCP": 0, | ||
"LCP": 3300 | ||
"LCP": 0 | ||
} | ||
} | ||
}, | ||
|
@@ -4937,14 +4937,14 @@ | |
"id": "legacy-javascript", | ||
"title": "Avoid serving legacy JavaScript to modern browsers", | ||
"description": "Polyfills and transforms enable legacy browsers to use new JavaScript features. However, many aren't necessary for modern browsers. For your bundled JavaScript, adopt a modern script deployment strategy using module/nomodule feature detection to reduce the amount of code shipped to modern browsers, while retaining support for legacy browsers. [Learn how to use modern JavaScript](https://web.dev/articles/publish-modern-javascript)", | ||
"score": 0.5, | ||
"score": 0, | ||
"scoreDisplayMode": "metricSavings", | ||
"numericValue": 450, | ||
"numericUnit": "millisecond", | ||
"displayValue": "Potential savings of 26 KiB", | ||
"metricSavings": { | ||
"FCP": 0, | ||
"LCP": 0 | ||
"LCP": 150 | ||
}, | ||
"details": { | ||
"type": "opportunity", | ||
|
@@ -5013,7 +5013,7 @@ | |
"type": "debugdata", | ||
"metricSavings": { | ||
"FCP": 0, | ||
"LCP": 0 | ||
"LCP": 150 | ||
} | ||
} | ||
}, | ||
|
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now this is surprising. LCP savings should be going down not up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did some investigation using
PageDependencyGraph.printGraph
and here are the results foruses-text-compression
LCP (may want to paste into a different viewer to see better):The most important difference I spotted was that
lighthouse-rotating.gif
is missing from the optimistic graph and yet it is the last node to finish. This means the byte savings on the seconddbw_tester.html
graph shouldn't impact the pessimistic simulation because the seconddbw_tester.html
is downloaded in parallel withlighthouse-rotating.gif
. This just happens to be the way the requests downloaded, and therefore we can't rely on the optimistic graph providing a smaller savings estimate than the pessimistic graph for LCP.That being said, both optimistic and pessimistic LCP graphs cast very wide nets when deciding which network requests to include and that might just make the results kinda noisy. It might be worth looking into a new optimistic LCP definition that focuses on the specific LCP request.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Took a look at only a handful of sites, seems like pessimistic savings being lower than optimistic savings only occasionally happens and solely for LCP.
We could:
i'm open to both, though leaning on (1) to prioritize these audits less when sorting.
I agree, worth taking note of this to dive into later
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
adam convinced me of going with 2. let's leave a comment in there about this weirdness.