-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
performance-impls: LCP should use startTime #35070
Conversation
Fixes #34383 |
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.
Just commenting to flag the .only
so it isn't forgotten
Co-authored-by: Ryan Cebulko <ryan@cebulko.com>
Hey @jridgewell! These files were changed:
|
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.
if (entry.renderTime) { | ||
this.largestContentfulPaintRenderTime_ = entry.renderTime; | ||
} | ||
this.largestContentfulPaint_ = entry.startTime; |
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.
Do all browsers support startTime
?
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.
Yes, this is also how the web-vitals package implements it.
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.
@jridgewell: I've updated TICKEVENTS.md
in 79da311
summary
There isn't much utility in separately tracking LCP Load and LCP Render.
loadTime
corresponds to when the resource associated with a node has been loaded from network. It is always available on every node, but is relatively meaningless for any non-remote resource on a page. For example, all<h1>
tags have a loadTime, but that time is 0. Therefore if a text node were chosen as the LCP Element, we'd report 0 for LCP-L.renderTime
corresponds to when the node is painted to the screen. This has a meaningful value for text nodes, but ends up being absent for any crossorigin resource without aTiming-Allow-Origin
header. In these cases it is recommended to fallback to loadTime since the numbers will be relatively close to each other. Since AMP Caches usually host all their images, this is also not a very strong factor for AMP.cc @ampproject/wg-performance