-
Notifications
You must be signed in to change notification settings - Fork 213
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Autocomplete: Split debounce into two chunks, race the second part wi…
…th the context retrieving (#3149) This PR splits the debounce time into two logical chunk. The first 25ms (regardless of how long the debounce time is defined), the behavior will be like it is now: We batch events and don't do any concurrent work. However after 25ms (which, remember, was the debounce time we had until recently), we start to fetch the context in parallel. The idea is that we have shave off up to 50ms from the context retrieval time. Here's a visualization of a trace: <img width="1724" alt="Screenshot 2024-02-13 at 11 37 12" src="https://github.com/sourcegraph/cody/assets/458591/d8366a19-d0dd-4d20-a2bc-3b301d5e6211"> As you can see in this specific example, context retrieval could almost be free. One caveat here is that this _will_ increase CPU pressure (since we start fetching context a bit earlier). That's why I think 25ms is a good value for this since we have used it in the past with the same retrieval algorithm quite successfully. ## Test plan - Ensure AC still works - Check out a trace <img width="1718" alt="Screenshot 2024-02-13 at 11 47 14" src="https://github.com/sourcegraph/cody/assets/458591/37acfa14-f4a2-421b-813c-c5dd2b25b174">
- Loading branch information
1 parent
1774aa6
commit b50e9c6
Showing
5 changed files
with
40 additions
and
15 deletions.
There are no files selected for viewing
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
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
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
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
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