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

Performance: Prefetch file blobs from search results#41420

Merged
umpox merged 11 commits into
mainfrom
tr/prefetch-search-files
Sep 8, 2022
Merged

Performance: Prefetch file blobs from search results#41420
umpox merged 11 commits into
mainfrom
tr/prefetch-search-files

Conversation

@umpox

@umpox umpox commented Sep 7, 2022

Copy link
Copy Markdown
Contributor

Description

This PR adds support for prefetching blobs from the search results through hover or focus, through the experimental feature enableSearchFilePrefetch

This should significantly speed up time from search results -> viewing code, especially now we have no waterfall logic between these components

Before

PrefetchSearchBefore8Sept.mp4

After

PrefetchSearchAfter8Sept.mp4

Test plan

Tested locally with different configurations of highlighting / file viewer

@cla-bot cla-bot Bot added the cla-signed label Sep 7, 2022
@github-actions github-actions Bot added the frontend-platform Issues related to our frontend platform, owned collectively by our frontend crew. label Sep 7, 2022
}
isSelected={isSelected}
revision={commitID}
revision={revision}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: This fixes a bug where the sidebar prefetch logic wasn't being used correctly, as we no longer rely on the resolvedRev for the commitID (we use the URL as a source of truth instead, and let the backend resolve it)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

@umpox umpox requested review from a team, eseliger, limitedmage and valerybugakov September 7, 2022 14:45
@umpox umpox marked this pull request as ready for review September 7, 2022 14:45
@sourcegraph-bot

sourcegraph-bot commented Sep 7, 2022

Copy link
Copy Markdown
Contributor

Codenotify: Notifying subscribers in CODENOTIFY files for diff 5d198e4...ca1ac39.

Notify File(s)
@fkling client/search-ui/src/results/StreamingSearchResultsList.tsx
client/web/src/search/results/StreamingSearchResults.tsx
@limitedmage client/search-ui/src/results/StreamingSearchResultsList.tsx
client/web/src/search/results/StreamingSearchResults.tsx

@umpox umpox requested a review from fkling September 7, 2022 14:51

@limitedmage limitedmage left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!!

*
* Note: This format should match the format used when the blob is 'normally' fetched. E.g. in `BlobPage.tsx`.
*/
export const usePrefetchBlobFormat = (): HighlightResponseFormat => {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚡️

@valerybugakov valerybugakov left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥

@umpox umpox merged commit 5a6b255 into main Sep 8, 2022
@umpox umpox deleted the tr/prefetch-search-files branch September 8, 2022 15:53
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla-signed frontend-platform Issues related to our frontend platform, owned collectively by our frontend crew.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants