Optimize source viewer rendering
What does this MR do and why?
This is a follow-up from !101625 (merged) to make further optimizations in the source viewer to bring down Total Blocking Time (TBT).
- Render below-the-fold content once the browser goes into idle.
- Make use of
v-once
for content that does not need to be reactive once rendered. - Remove useless instantiation of
copyCode
for non-markdown content.
Screenshots or screen recordings
before | after |
---|---|
TBT: 1090ms | TBT: 537ms |
How to set up and validate locally
- Open a source file via the repository files list
- Run a performance audit
- 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.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #343649 (closed)
Edited by Jacques Erasmus