Skip to content

Commit b17682a

Browse files
Change the delay for how often we synchronize solutions
Now that we're doing all the WorkspaceChanged notifications on background threads, that means the notifications won't be quite as batched as before; this was causing an increase in synchronizations that was creating some wasted work.
1 parent 452703e commit b17682a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/EditorFeatures/Core/Remote/SolutionChecksumUpdater.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,13 @@ public SolutionChecksumUpdater(
5858

5959
_shutdownToken = shutdownToken;
6060

61+
// A time span of Short is chosen here to ensure that the batching favors fewer but larger batches.
62+
// During solution load a large number of WorkspaceChange events might be raised over a few seconds,
63+
// and in performance tests a 50ms delay was found to be causing a lot of extra memory churn synchronizing
64+
// things OOP. Short didn't cause a similar issue; it's possible this will need to be fine tuned for something in
65+
// the middle.
6166
_synchronizeWorkspaceQueue = new AsyncBatchingWorkQueue(
62-
DelayTimeSpan.NearImmediate,
67+
DelayTimeSpan.Short,
6368
SynchronizePrimaryWorkspaceAsync,
6469
listener,
6570
shutdownToken);

0 commit comments

Comments
 (0)