-
Notifications
You must be signed in to change notification settings - Fork 209
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
Autocomplete: Various latency related tweaks and new eager cancellation experiment #3096
Conversation
const isEagerCancellationEnabled = completionProviderConfig.getPrefetchedFlag( | ||
FeatureFlag.CodyAutocompleteEagerCancellation | ||
) | ||
const debounceInterval = isLocalProvider ? 125 : isEagerCancellationEnabled ? 10 : 75 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔥 ☄️
if (!eagerCancellation) { | ||
this.testIfResultCanBeRecycledForInflightRequests( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we keep this functionality when eagerCancellation === true
? We can throttle (is it the right word here?) requests — with low debounce, we will have them almost on every keystroke, but instead of canceling all of them but the last one, we can keep on request in every number of requests made in the previous 100ms + always keep the tail one.
This way, we preserve the nice UX where the completion is generated early, and a user continues typing as suggested AND decrease the tail completion delay by 65ms. WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’m not sure I understand this right. If we want to keep this, we would have to keep more than just the last request alive (so that another request can actually answer another one). Are you recommending we keep all but the last 2 completions active?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discussed on the call. We're going to follow-up on that in a separate PR.
A few small tweaks from my learnings of looking at some traces:
eager cancellation
experiment that will cancel requests as soon as a new request is created and reduces the debounce time significantly to try and counter the latency regressionTest plan