-
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
lantern: keep first layout/paint/parse events regardless of duration #9922
Conversation
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 think this is exactly what we need :) 👍
unfortunately the exact code we use to filter this is going to completely change if we decide to move forward with #9910 (comment) :/
maybe we hold off on hardening this but we keep it open in draft to ensure the numbers don't change on us too much?
Is this still relevant? |
"optimistic": 1307, | ||
"pessimistic": 1307, | ||
"timing": 1307, | ||
"optimistic": 1337, |
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.
nice
meta note: it'd be nice if we saved a summary of |
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.
a bummer that this accidentally hurts the basket sites slightly and doesn't fix any of those cases, but it's definitely more true to life and should fix #9627
LGTM % the weird node count thing being nothing
// Don't prune this node. The task is long so it will impact simulation. | ||
// Don't prune if event is the first ParseHTML/Layout/Paint. | ||
// See https://github.com/GoogleChrome/lighthouse/issues/9627#issuecomment-526699524 for more. | ||
let isFirst = false; |
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.
let isFirst = false; | |
let isFirstOfImportantEventType = false; |
maybe? :)
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.
does this really help with understanding? kinda a mouth full (mind full?) to read
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.
helps IMO, but I don't feel strongly can skip if you think it makes things worse
@@ -66,7 +66,7 @@ describe('FirstInteractive computed artifact:', () => { | |||
pessimistic: Math.round(result.pessimisticEstimate.timeInMs), | |||
}).toMatchSnapshot(); | |||
assert.equal(result.optimisticEstimate.nodeTimings.size, 19); | |||
assert.equal(result.pessimisticEstimate.nodeTimings.size, 79); | |||
assert.equal(result.pessimisticEstimate.nodeTimings.size, 80); |
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.
curious and very unexpected that the optimistic estimate already included this somehow but the pessimistic didn't...
can we double check this? might point to a bug we're both missing
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.
is it b/c cpu idle uses fmp like this?
static getEstimateFromSimulation(simulation, extras) {
const fmpTimeInMs = extras.optimistic
? extras.fmpResult.optimisticEstimate.timeInMs
: extras.fmpResult.pessimisticEstimate.timeInMs;
return {
timeInMs: LanternFirstCPUIdle.getFirstCPUIdleWindowStart(simulation.nodeTimings, fmpTimeInMs),
nodeTimings: simulation.nodeTimings,
};
}
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.
That doesn't change the size of the nodeTimings
map though, so I don't think it could affect this.
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.
No idea how to debug this.
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'll take a look
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.
Ah it's not that the optimistic estimate already had it, it's just that it still gets filtered out by the optimistic estimate.
lighthouse/lighthouse-core/computed/metrics/lantern-interactive.js
Lines 40 to 43 in 4367845
// Include everything that might be a long task | |
if (node.type === BaseNode.TYPES.CPU) { | |
return node.event.dur > minimumCpuTaskDuration; | |
} |
This is slightly suboptimal but OKish from the simulation perspective because we're flooring on the first paint metrics if we end up too early and if it's that short it's unlikely to have a large impact to the last long task.
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.
cool, thanks for looking!
Co-Authored-By: Patrick Hulce <[email protected]>
Fixes #9627
Lantern
master
pr