Skip to content

Perf: .Result blocks MailboxProcessor thread in FSharpProjectOptionsManager #20125

Open

Description

@xperiandri

Description

FSharpProjectOptionsManager.fs's hasDependentVersionChanged used blocking .Result calls on GetDependentVersionAsync(ct).Result when comparing non-F# project references. Since this function is invoked from isProjectInvalidated, which is called from tryComputeOptions / tryComputeOptionsBySingleScriptOrFile inside the FSharpProjectOptionsReactor's MailboxProcessor loop, these synchronous waits could block the single-threaded reactor loop during project invalidation, causing UI/background responsiveness issues.

Repro / Evidence

Identified via CPU profiling of background F# editor activity in Visual Studio; located via code search for .Result usages in vsintegration/src/FSharp.Editor.

Fix

Convert hasDependentVersionChanged and isProjectInvalidated to cancellableTask workflows using let! instead of .Result, so the invalidation path is fully async and no longer blocks the mailbox loop.

Priority

P2 (medium-term)

Activity

  1. added this to the Backlog milestone on Aug 3, 2026
  2. added a commit that references this issue on Aug 3, 2026
    c756137
  3. changed the title [-]Perf: .Result blocks MailboxProcessor thread in FSharpProjectOptionsManager[/-] [+]Perf: `.Result` blocks `MailboxProcessor` thread in `FSharpProjectOptionsManager`[/+] on Aug 3, 2026
  4. added 8 commits that reference this issue on Aug 16, 2026
    aff3434
    8a0ac04
    71411b6
    fc02536
    78fafa1
    109bf66
    a1c2489
    19ddb31
  5. added 4 commits that reference this issue on Sep 30, 2026
    7120bec
    414e538
    6f2d645
    07ba63c
  6. added 6 commits that reference this issue on Oct 19, 2026
    ead9ac5
    6b202dc
    9ca4e69
    80ae4e2
    513d7b0
    4f835d1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions