Description
When C# projects change, Roslyn creates new Compilation instances. The F# IDE integration currently uses a ConditionalWeakTable to cache the emitted PE reference from these compilations. Because new Compilation objects are continually created by Roslyn, the weak table cache misses, causing repeated, expensive metadata-only emissions (Compilation.Emit(metadataOnly=true)). This contributes to UI latency and background CPU churn.
Expected Behavior
We should add a cache based on a stable identifier, such as (ProjectId, project.Version), to avoid re-emitting assemblies unnecessarily when the underlying C# project hasn't functionally changed.
Actual Behavior
The IDE often experiences excessive background activity because it forces frequent PE emissions for the same actual logic state.
Description
When C# projects change, Roslyn creates new
Compilationinstances. The F# IDE integration currently uses aConditionalWeakTableto cache the emitted PE reference from these compilations. Because newCompilationobjects are continually created by Roslyn, the weak table cache misses, causing repeated, expensive metadata-only emissions (Compilation.Emit(metadataOnly=true)). This contributes to UI latency and background CPU churn.Expected Behavior
We should add a cache based on a stable identifier, such as
(ProjectId, project.Version), to avoid re-emitting assemblies unnecessarily when the underlying C# project hasn't functionally changed.Actual Behavior
The IDE often experiences excessive background activity because it forces frequent PE emissions for the same actual logic state.