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(render-blocking-resources): add FCP and LCP savings #15238

Merged
merged 3 commits into from
Jul 11, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions core/audits/byte-efficiency/render-blocking-resources.js
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ class RenderBlockingResources extends Audit {
numericValue: wastedMs,
numericUnit: 'millisecond',
details,
metricSavings: {FCP: wastedMs, LCP: wastedMs},
Copy link
Member

@adamraine adamraine Jul 10, 2023

Choose a reason for hiding this comment

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

Using the existing wastedMs makes sense for now, but wastedMs is computed using the FCP graph. I do wonder if computing a second LCP wastedMs with the LCP graph would also be useful.

This requires more investigation, so I'll open a separate issue to track this.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ah something like what we have to do with uses-rel-preconnect?

separate issue sounds good to me!

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, I imagine we'll copy the FCP implementation for LCP and see how big the difference is.

};
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ describe('Render blocking resources audit', () => {
const result = await RenderBlockingResourcesAudit.audit(artifacts, {settings, computedCache});
assert.equal(result.score, 1);
assert.equal(result.numericValue, 0);
assert.deepStrictEqual(result.metricSavings, {FCP: 0, LCP: 0});
});

it('evaluates amp page correctly', async () => {
Expand Down Expand Up @@ -87,6 +88,7 @@ describe('Render blocking resources audit', () => {
// it look like Montserrat starts after Fira Sans finishes. It would be preferred
// if eventual simulation improvements list Montserrat here as well.
]);
expect(result.metricSavings).toEqual({FCP: 450, LCP: 450});
});

describe('#estimateSavingsWithGraphs', () => {
Expand Down