Skip to content

Commit

Permalink
Pooling
Browse files Browse the repository at this point in the history
  • Loading branch information
CyrusNajmabadi committed Jul 11, 2024
1 parent 8cf03d3 commit 0b0cb32
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,13 @@ private async Task PerformSearchAsync(
//
// This is a normal dictionary that is not locked. It is only ever read and written to serially from within the
// high level project-walking code in this method.
var symbolToGroup = new Dictionary<ISymbol, SymbolGroup>(MetadataUnifyingEquivalenceComparer.Instance);
using var _1 = s_symbolToGroupPool.GetPooledObject(out var symbolToGroup);

var unifiedSymbols = new MetadataUnifyingSymbolHashSet();
unifiedSymbols.AddRange(symbols);

var disposable = await _progressTracker.AddSingleItemAsync(cancellationToken).ConfigureAwait(false);
await using var _ = disposable.ConfigureAwait(false);
await using var _2 = disposable.ConfigureAwait(false);

// Create the initial set of symbols to search for. As we walk the appropriate projects in the solution
// we'll expand this set as we discover new symbols to search for in each project.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public async Task FindReferencesInDocumentsAsync(
//
// This is a normal dictionary that is not locked. It is only ever read and written to serially from within the
// high level project-walking code in this method.
var symbolToGroup = new Dictionary<ISymbol, SymbolGroup>(MetadataUnifyingEquivalenceComparer.Instance);
using var _ = s_symbolToGroupPool.GetPooledObject(out var symbolToGroup);

var unifiedSymbols = new MetadataUnifyingSymbolHashSet
{
Expand Down

0 comments on commit 0b0cb32

Please sign in to comment.