-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Slow down the work navbar does, and cancel updating it when receiving a high volume of user events #73680
Conversation
… a high volume of user events
src/EditorFeatures/Core/NavigationBar/NavigationBarController.cs
Outdated
Show resolved
Hide resolved
@@ -64,7 +64,7 @@ internal partial class NavigationBarController : IDisposable | |||
/// compute the model once for every batch. The <c>bool</c> type parameter isn't used, but is provided as this | |||
/// type is generic. | |||
/// </summary> | |||
private readonly AsyncBatchingWorkQueue<bool, NavigationBarModel?> _computeModelQueue; | |||
private readonly AsyncBatchingWorkQueue<VoidResult, NavigationBarModel?> _computeModelQueue; |
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.
switched to VoidResult to make it clear this value isn't used.
asyncListener, | ||
_cancellationTokenSource.Token); | ||
|
||
_selectItemQueue = new AsyncBatchingWorkQueue( | ||
DelayTimeSpan.NearImmediate, | ||
DelayTimeSpan.Short, |
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.
changed the cadence on this, couldn't observe any problem at this speed.
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 couldn't perceive any issue changing this. And it helps us not hit the UI thread too often while doing something like scrolling quickly. There's little value in having the nav bars have to update that quickly, especially as it forces a UI thread switch that we're seeing in UI delays.