Ensure the LCP metric on the Project Homepage is consistently gathered on the same area of content
Context / Problem
The way that Largest Contentful Paint (LCP) https://web.dev/lcp/ works is, quoting web.dev:
The Largest Contentful Paint (LCP) metric reports the render time of the largest image or text block visible within the viewport,
This works remarkably well for content rich pages but in more webapp-like content, it can introduce some variability on which element this metric latches on to.
Examples |
---|
Links:
- https://gitlab.com/ddevault/scdoc
- https://gitlab.com/gitlab-org/gitlab (screenshot is from 10k reports)
Proposal
It is in the best interest of our performance efforts that this metric be gathered in the same area of content regardless of the temporary content that might pop up on the page, this ensuring the metric is representative of actual improvements and regressions in performance.
Thus, we should look at ways to ensure the LCP on the Project Overview page is gathered on the same area consistently. Potentially the project heading.
Note: the goal here isn't to "game the system" and fake lower numbers but to ensure the metric is robust in regards to temporary content like the GitLab commit broadcast message was.
Further work
-
#338613 Add User Timing API marks and measures to Project Overview page / repository browser
- To ensure better understanding of the various moments of the Project Homepage loading, we should consider also adding User Timing API marks and measurements like we did for the MR. #216943 (closed)