[go: up one dir, main page]

Skip to content

Use fixed height diff lines to improve performance

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Right now the MR Changes page uses Virtual Scrolling solution to render diffs. It works well except for the part where it needs to pre-render the whole list of diffs. This operation is thread blocking so it introduces an input delay or frame drops and it's also the main reason for high TBT numbers in our SiteSpeed pipeline.

We could solve that by having a non-wrapping mode for diff lines, which would also require us to rework the diff file layout. That would allow us to skip the pre-render step because the height of each diff would be known in advance.

For the diffs that contain discussions or if the non-wrapping mode is disabled we could just keep the pre-render step, so the functionality stays exactly the same for end user no matter what mode is chosen or if a diff has discussions. We can further improve that in the future by making code discussions float.

This change could also significantly benefit the diffs SSR experiment because we'd be able to reliably use content-visibility with the same logic.

Edited by 🤖 GitLab Bot 🤖