Skip to content

Optimize source viewer rendering

Jacques Erasmus requested to merge 343649-source-viewer-tbt-improvements into master

What does this MR do and why?

Optimizes rendering in the source viewer in an attempt to bring down Total Blocking Time (TBT).

  1. Reduce the amount of HTML to render.
  2. Leverage Vue caching (move repetitive calculations to a method).
  3. Reduce browser resources spent on content that is not yet visible (content-visibility: auto).
  4. Follow-up: explore the idea of highlighting content in a webworker before Vue is bootstrapped.

Screenshots or screen recordings

before after
TBT: 2388ms TBT: 1605ms
LCP: 2427ms LCP: 2187ms
Screenshot_2022-10-20_at_13.34.10 Screenshot_2022-10-20_at_13.32.12

How to set up and validate locally

  1. Open a source file via the repository files list
  2. Run a performance audit
  3. Take note of the TBT performance metric

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #343649 (closed)

Edited by Jacques Erasmus

Merge request reports