-
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(lantern): allow non-XHRs to depend on CPU Nodes #11767
Conversation
Thanks so much @warrengm this looks like a great improvement from the numbers! 🎉 Conceptually they were excluded because My hunch on what you're seeing with images and stylesheets is what remains of that original concern, but definitely appears to be a big win overall 🎉
For sure, the safest version of this change that sticks with the original conservativeness would be only expanding this to fetch and other scripts rather than all network requests. If that preserves a majority of the accuracy improvements, that'd probably be my ideal change, but if the aggregate wins do come from other types, then I think we're in a much better place to proceed there today too than we were in 2017. |
Updating the condition to improve accuracy sounds good! Carving out Image and Stylesheets had an improvement, but carving out Other and I also had some thoughts about it probably matters whether the request was initiated at the start of the task or the end, but that is probably too hard to model now. |
FYI our target release for v7 is Wed/Th. Let us know if you need an assist here. |
sounds good @warrengm let me know if you need any help here! |
I think this is good to review. The failures seem to be the same that have been discussed for other PRs |
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 cool cool! the redirectedResourceType
and one test diff only obstacles I see, looks great otherwise, thanks for this! 💯
"default": 1330, | ||
"justTTI": 800, | ||
"default": 960, | ||
"justTTI": 960, |
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.
we might need to adjust the test graph we use so these are different
@@ -266,7 +266,7 @@ describe('Byte efficiency base audit', () => { | |||
const result = await MockAudit.audit(artifacts, {settings, computedCache}); | |||
const resultTti = await MockJustTTIAudit.audit(artifacts, {settings, computedCache}); | |||
// expect less savings with just TTI | |||
expect(resultTti.numericValue).toBeLessThan(result.numericValue); | |||
expect(resultTti.numericValue).toBeLessThanOrEqual(result.numericValue); |
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.
this assertion was hard coded because it is the test :) we'll need to construct a different graph to get the same value if TTI is the same as the last node timing now
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 cool to have computeWasteWithTTIGraph
just return a fixed number? IMO that would make it clear that were testing subclassing.
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's fine if we don't have any other traces that are different in this regard. I'd be bummed to lose a bit of the double duty testing that computeWasteWithTTIGraph does its job correctly, but we can address that another 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.
That makes sense. I cheated to get the test to pass now since I'm not sure how to construct the right graph.
Here it might be good to have each unit tests test one thing. So maybe test computeWasteWithTTIGraph
directly by calling it with different options or at least have sibling classes where you're not testing overriding.
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.
:) you're right of course and we should finally get around to that since this base is the foundation of many different opportunities. filed #11802 👍
lighthouse-core/test/fixtures/lantern-master-computed-values.json
Outdated
Show resolved
Hide resolved
shoot, it looks like basics weren't failing because test-lantern wasn't finding the touched files anymore 🤦
|
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.
Done. Rerunning the checks now! |
Summary
This fixes an issue that @jburger424 found in a test page where we deliberately inserted a long task before loading a script, but that wasn't reflected in results. (So the simulated load time was actually better than the real load time)
More generally I don't think we want to special case XHRs since it ignores fetch and jsonp requests which are similar enough.
Impact is as follows:
I found that excluding images and stylesheets does reduce LCP error--which is somewhat surprising because I would expect those edges to be more accurate for pages that dynamically insert images. I'd think we want to capture the impact of long tasks on LCP in those cases.
Related Issues/PRs
It seems to have been implemented this way from the start: #3162. Not sure why the decision was made to ignore XHRs though.