-
Notifications
You must be signed in to change notification settings - Fork 307
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use local cache instead of localStorage to get repo status #5798
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hitesh-1997
requested review from
arafatkatze,
RXminuS,
valerybugakov and
abeatrix
October 3, 2024 21:19
abeatrix
approved these changes
Oct 3, 2024
hitesh-1997
added a commit
that referenced
this pull request
Oct 3, 2024
## Context Fixes #5787 and #5780 1. The PR removes the caching introduced in the vscode `localStorage` in the [PR](https://github.com/sourcegraph/cody/pull/5767/files#diff-795b77ed195550f3e764295bad38afdec49b0f2ad96476c63c945df119b561f7R40) to get the repo status, and uses local cache to store the results. 2. get request from `localStorage` was being triggered for every logging request [here](https://github.com/sourcegraph/cody/blob/main/vscode/src/completions/logger.ts#L741) causing the slowness in vscode workspace. ## Test plan Do this test before and after the PR commits. 1. Open multiple workspace in vscode in the debug mode. 2. Follow the steps listed by @arafatkatze [here](#5787 (comment)) to get the cpu profiling data. 4. Type something really fast. We should be able to see the lags introduced when typing. 5. In addition, use https://www.speedscope.app/ to visualize the profiling data gathered. 6. Profiling data before/after this PR <img width="1512" alt="image" src="https://github.com/user-attachments/assets/1056adbf-d57e-4470-b553-06fab83470a1"> Logs Link: 1. [after_pr_change.cpuprofile.txt](https://github.com/user-attachments/files/17250317/after_pr_change.cpuprofile.txt) 2. [before_pr_change.cpuprofile.txt](https://github.com/user-attachments/files/17250318/before_pr_change.cpuprofile.txt) ## Changelog - Fixes the vscode slowness issue when completions is turned on.
This was referenced Oct 3, 2024
Closed
hitesh-1997
added a commit
that referenced
this pull request
Oct 3, 2024
hitesh-1997
added a commit
that referenced
this pull request
Oct 3, 2024
## Context Fixes #5787 and #5780 1. The PR removes the caching introduced in the vscode `localStorage` in the [PR](https://github.com/sourcegraph/cody/pull/5767/files#diff-795b77ed195550f3e764295bad38afdec49b0f2ad96476c63c945df119b561f7R40) to get the repo status, and uses local cache to store the results. 2. get request from `localStorage` was being triggered for every logging request [here](https://github.com/sourcegraph/cody/blob/main/vscode/src/completions/logger.ts#L741) causing the slowness in vscode workspace. ## Test plan Do this test before and after the PR commits. 1. Open multiple workspace in vscode in the debug mode. 2. Follow the steps listed by @arafatkatze [here](#5787 (comment)) to get the cpu profiling data. 4. Type something really fast. We should be able to see the lags introduced when typing. 5. In addition, use https://www.speedscope.app/ to visualize the profiling data gathered. 6. Profiling data before/after this PR <img width="1512" alt="image" src="https://github.com/user-attachments/assets/1056adbf-d57e-4470-b553-06fab83470a1"> Logs Link: 1. [after_pr_change.cpuprofile.txt](https://github.com/user-attachments/files/17250317/after_pr_change.cpuprofile.txt) 2. [before_pr_change.cpuprofile.txt](https://github.com/user-attachments/files/17250318/before_pr_change.cpuprofile.txt) ## Changelog - Fixes the vscode slowness issue when completions is turned on.
Merged
hitesh-1997
added a commit
that referenced
this pull request
Oct 4, 2024
- Autocomplete: The PR fixes the slowness in vscode because because of completions by using local cache instead of querying vscode localStorage. [pull/5798](#5798) - Sourcegraph API GraphQL: Increase the default timeout from 6sec to 20sec. [pull/5789](#5789) ## Test plan Cherry-pick commits & update changelog, version --------- Co-authored-by: Quinn Slack <quinn@slack.org>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context
Fixes #5787 and #5780
localStorage
in the PR to get the repo status, and uses local cache to store the results.localStorage
was being triggered for every logging request here causing the slowness in vscode workspace.Test plan
Do this test before and after the PR commits.
Logs Link:
Changelog