-
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): compute FCP & LCP savings #15104
Conversation
Run on cnn.com w/ simulated throttling. CNN changes content a lot so this isn't a mirror image of the analysis above. https://googlechrome.github.io/lighthouse/viewer/?gist=7e431eebd16bc37944e9b1ceaff80c3b Using pessemistic graph
Using optimistic graph:
Notes:
|
if (lcpRecord && lcpBreakdown.loadStart && lcpBreakdown.loadEnd) { | ||
const lcpResult = results.find(result => result.url === lcpRecord.url); | ||
if (lcpResult) { | ||
const lcpLoadTime = lcpBreakdown.loadEnd - lcpBreakdown.loadStart; |
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.
the benefit is only to download time.. but this loadTime duration includes ttfb time
tbh looking at your original results I'd say that the image audits were not underestimating LCP savings
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.
What do you mean "includes ttfb time"? lcpLoadTime
is supposed to represent the "Resource load time" phase of LCP so it's just the download time.
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.
tbh looking at your original results I'd say that the image audits were not underestimating LCP savings
In the first set of results, modern-image-formats
reports 0 savings on LCP when calculated using the LCP graph even though the LCP image is listed in that audit. This is definitely an underestimate IMO.
{providedWastedBytesByUrl: result.wastedBytesByUrl, label: 'lcp'} | ||
); | ||
|
||
// The LCP graph can underestimate the LCP savings if there is potential savings on the LCP record itself. |
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'm having trouble understanding this. How is this the case? If the LCP node download time is reduced, why isn't the simulation taking that into account when returning LCP savings?
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.
Graph timings are computed using the end time of the entire graph, the LCP request node is not necessarily the final node in the graph. Presumably, it's possible for the node that marks the end of the entire graph to have it's timing unaffected by changes to the LCP request node.
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.
Can you provide a breakdown for a specific example where this is the case? I'd expect there to be some dependency between the final node (is it the CPU node that has the layout?) and the network request node whose bytes are being reduced.
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.
The case in the PR comment is an example of this happening. LCP image is listed modern-image-formats
but the LCP graph savings are 0. I did not save any artifacts other than the trace, so I'll try and get another example of such a case.
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.
Here is an example I captured with DT throttling. modern-image-formats
shows the LCP record savings as larger than the LCP graph savings:
artifacts.json.zip
traceAndDtLog.zip
(had to split it up because it was too big for GH)
First pass at computing FCP / LCP graph savings for byte efficiency audits. To gauge these estimates, I did a DT throttling run on cnn.com:
https://googlechrome.github.io/lighthouse/viewer/?gist=3101939dec6e6aa3c54ef73af500b86a
https://trace.cafe/t/QxCTNKUbin
My initial read:
unused-javascript
FCP/LCP estimates seem appropriate. All of the pre-FCP downloads and many of the pre-LCP downloads are JS.uses-responsive-images
andmodern-image-formats
are underestimating the impact on LCP