Skip to content

Conversation

@adamsilverstein
Copy link

@adamsilverstein adamsilverstein commented Dec 5, 2024

Part of #16261.

@adamsilverstein adamsilverstein requested a review from a team as a code owner December 5, 2024 23:06
@adamsilverstein adamsilverstein requested review from connorjclark and removed request for a team December 5, 2024 23:06

const wastedMs = lcpTimingsBefore.endTime -
Math.max(lcpTimingsAfter.endTime, maxDependencyEndTime);
Math.max(lcpTimingsAfter.endTime, maxDependencyEndTime > lcpTimingsBefore.endTime ? lcpTimingsBefore.endTime : maxDependencyEndTime);
Copy link
Author

@adamsilverstein adamsilverstein Dec 5, 2024

Choose a reason for hiding this comment

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

Another option would be to throw an error for this case, what do you think? Do we need to dig deeper into why maxDependencyEndTime is greater than lcpTimingsAfter.endTime?

Copy link
Contributor

Choose a reason for hiding this comment

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

Let's not throw an error, but I don't think this PR should close #16261

Also could we do something like wastedMs = Math.max(wastedMs, 0) on the line below this. I think that would make this easier to read.

@adamsilverstein adamsilverstein changed the title Report wastedMs as 0 when maxDependencyEndTime > lcpTimingsBefore.end… Report wastedMs as 0 instead of a negative number [type-bug] Dec 5, 2024
@adamraine adamraine changed the title Report wastedMs as 0 instead of a negative number [type-bug] core(prioritize-lcp-image): report negative savings as 0 Dec 9, 2024
@connorjclark
Copy link
Collaborator

connorjclark commented Dec 11, 2024

I don't like this sort of fix because it covers up this and future problems. I suggest not doing this, but defer to @adamraine

@paulirish
Copy link
Member

Audit is being replaced by LCP discovery insight. Appreciate you contributing this fix though!

@paulirish paulirish closed this Jun 11, 2025
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.

4 participants