I started poking around GitLab's frontend performance issues back on November 3, mostly because web performance is what I spend my day job thinking about anyway. Looked through epic &3284 first, which says around 52% of the JavaScript shipped on every GitLab page goes unused at first paint, and picked up a handful of small lazy-load fixes alongside something much messier in the repository view.

The early bundle fixes were mostly just hunting down stray imports. Like on the dependency firewall dashboard (!267453), active_policies_table.vue was pulling getSecurityPolicyListUrl out of source_editor_security_policy_schema_ext.js, which meant a plain table page was dragging the Monaco editor in with it just to build one link. Moved that helper into security_policy_url_utility.js and pointed the dashboard and four security policy components at it. Did similar cleanups on find-and-replace (!267590), the EE trial banner (!267748), the Duo UI translations that were still shipping in Community Edition (!269711), and the SAML reload modal (!267749), where Peter Hegman pointed out during review that splitting initSamlReloadModal into its own reload.js file keeps #js-saml-reload from pulling in the rest of saml_sso/index.js.

Emoji rendering (!269712) caught me off guard a bit. I thought moving gl_emoji_render.js behind the first <gl-emoji> element connecting would keep it off pages with no emoji, except user_popover.vue and security_patch_upgrade_alert_modal.vue were still importing the full helper just to build tag strings. Pulling a small gl_emoji_tag.js helper out for those two finally broke the chain. And on the GitLab Credits pages (!269715), initCreditsDashboard was loading both the Credits dashboard and the usage billing dashboard up front even though only one ever mounts based on el?.dataset?.isFree, so switching to conditional dynamic imports across the admin, group, and Organization routes kept the unused app out.

Around the same time I picked up issue #402772 on the repository file tree and blob viewer. The Source Code team noticed their LCP numbers were jumping all over the place depending on which repo or file you opened, because different folder and file lengths change which element happens to be the largest on screen. On top of that, both views virtualize as you scroll, so file rows and highlighted code chunks only render when they come into view and "page finished loading" changes with how tall your browser window is.

So I broke the User Timings work into two merge requests. In !267455 I only marked the two spots that mean the same thing on every visit, the first file-tree row in tree_content.vue and the first highlighted code chunk in source_viewer.vue and chunk.vue. Waiting for highlighting was the whole reason the existing <SourceViewer> timing wasn't enough, cause that older mark fires before syntax-highlighted code actually renders.

Then Jacques Erasmus and I talked through what "full render" should mean in #638419 so I could finish the rest in !271580. For the file tree we went with waiting for the last automatic page fetch, up to the 1,000-entry cutoff before anyone clicks "Show more", plus a $nextTick. For a file, highlight_mixin.js adds up totalLines across the highlighted chunks coming back from highlight_worker.js until that sum matches the raw file's line count, and I added separate marks for last_commit.vue and code_owners.vue while I was in there.

That landed nine frontend performance MRs in gitlab-org/gitlab between November 3 and November 27. I still have popover lazy-loading (!272884) and five other bundle MRs in review right now, and I'm planning to keep working through the rest of &22500.