Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

Performance: Investigate lazy syntax highlighting on search results #39603

@umpox

Description

@umpox

Description

Goal: Render search results faster

Reason:

  • Highlighting code takes noticeably longer than fetching file contents. One of the issues with the search results page is that we often see pop-in as we try to fetch new results (See video below). We should be able to solve that by immediately rendering formatting code and enhancing with highlighting.
  • It would be faster to run two parallel queries, one to fetch the current code and immediately render, and one to fetch the highlighted code and enhance the render.
  • We can reasonably say that code will generally always render fast in this way, so we can remove the loading spinner between files and have a much more editor-like experience.
ResultsPopIn.mp4

Related PR: https://github.com/sourcegraph/sourcegraph/pull/39563

A/C

  • Fetch file contents that has formatting but not highlighting. This will allow us to improve performance without introducing any layout shifts to the UX.
  • Feature flag this to experiment internally

/cc @taylorsperry @muratsu

Metadata

Metadata

Assignees

Labels

4.0items under consideration for 4.0UI performanceImprovements to the actual page rendering performance as well as perceived performance.frontend-platformIssues related to our frontend platform, owned collectively by our frontend crew.

Type

No type
No fields configured for issues without a type.

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions