Skip to content

Perf: Throttle parallel typechecks in Find All References - #20128

Draft
xperiandri wants to merge 2 commits into
dotnet:mainfrom
xperiandri:fix-find-references-throttle
Draft

Perf: Throttle parallel typechecks in Find All References#20128
xperiandri wants to merge 2 commits into
dotnet:mainfrom
xperiandri:fix-find-references-throttle

Conversation

@xperiandri

Copy link
Copy Markdown
Contributor

Fixes #20127

Problem

Project.FindFSharpReferencesAsync launched one CancellableTask per document in the project simultaneously via CancellableTask.whenAll, causing an unbounded number of parallel typechecks (one per document) at once during Find All References / Rename.

Fix

  • Added CancellableTask.whenAllThrottled maxDegreeOfParallelism in CancellableTasks.fs, using a SemaphoreSlim to cap concurrency while preserving cancellation semantics.
  • Applied it in Project.FindFSharpReferencesAsync (WorkspaceExtensions.fs), capping concurrency to max 1 Environment.ProcessorCount.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: New

Development

Successfully merging this pull request may close these issues.

Perf: Throttle parallel typechecks in Find All References

1 participant