dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
15.17k stars 4.72k forks source link

Very sluggish VS 2019 and VS 2022 performance starting with DotNet 6 Preview 5 related to Source Generators #56702

Closed fitdev closed 3 years ago

fitdev commented 3 years ago

Version Used: Latest Official DotNet 6 Preview 6 Latest VS previews: VS 2019 16.11 Preview 3 and VS 2022 Preview 2 C#: 10 (<LangVersion>preview</LangVersion>, including global usings in a few places)

Steps to Reproduce: VS typing performance quickly degrades (hangs, up to several seconds pauses between characters typing, etc.) after working with several cs files for like 20 minutes or more in the context of a medium-sized DotNet 6 Preview 6 solution with maybe 70 projects, each with ~ 10 to 500 files.

It started with DotNet6 Preview 5, which made VS 2019 run out of memory pretty quickly (GC was happening so often, that basically after about 1 hour of typing in a few files, it became unusable due to constant GC pauses, and VS's Private Bytes being near 2.5GB).

VS 2022 in this regard was very timely, but it did not improve things much. The performance is better compared with 2019, because GCs happen much more rarely and not as aggressively, but there are still very frequent hangs and slowdowns that happen more and more often as time goes on. This is actually happening while doing very mundane things - for example just editing a few 500-line files in an hour, perhaps renaming a few variables, etc. Nothing super-heavy like editing 100s of files, or refactoring whole namespaces, etc.

So I investigated this and came to conclude that Microsoft.CodeAnalysis was always the culprit.

Evidence: Stack Traces

First, in both VS 2019 and 2022, when I was examining stack traces of VS's threads during slowdowns, I saw references to Microsoft.CodeAnalysis.SourceGener* types all the time:

0, ntoskrnl.exe!KeWaitForSingleObject+0x30c1
1, ntoskrnl.exe!KeSynchronizeExecution+0x2e02
2, ntdll.dll!RtlAllocateHeap+0xca3
3, ntdll.dll!RtlAllocateHeap+0x16b
4, guard64.dll!Exported+0x1e20
5, clr.dll!CoUninitializeEE+0xa1a
6, clr.dll!CoUninitializeEE+0xb14
7, clr.dll!LogHelp_NoGuiOnAssert+0x6753a
8, clr.dll!LogHelp_NoGuiOnAssert+0x67b33
9, clr.dll!TranslateSecurityAttributes+0x1c13e7
10, System.Reflection.AssemblyName.GetAssemblyName(System.String) + 0x6a <-- mscorlib.ni.dll+0x5a806a
11, System.Linq.Enumerable.ToDictionary[[System.__Canon, mscorlib],[System.__Canon, mscorlib],[System.__Canon, mscorlib]](System.Collections.Generic.IEnumerable`1<System.__Canon>, System.Func`2<System.__Canon,System.__Canon>, System.Func`2<System.__Canon,System.__Canon>, System.Collections.Generic.IEqualityComparer`1<System.__Canon>) + 0xfb <-- System.Core.ni.dll+0x34282b
12, System.Text.Json.SourceGeneration.Reflection.MetadataLoadContextInternal..ctor(Microsoft.CodeAnalysis.Compilation) + 0x197 <-- 0x7ffa768141c7
13, System.Text.Json.SourceGeneration.JsonSourceGenerator+Parser..ctor(Microsoft.CodeAnalysis.GeneratorExecutionContext ByRef) + 0xfd <-- 0x7ffa76813d4d
14, System.Text.Json.SourceGeneration.JsonSourceGenerator.Execute(Microsoft.CodeAnalysis.GeneratorExecutionContext) + 0x60 <-- 0x7ffa76813b20
15, Microsoft.CodeAnalysis.SourceGeneratorAdaptor.<Initialize>b__4_5(Microsoft.CodeAnalysis.SourceProductionContext, GeneratorContextBuilder) + 0xf2 <-- 0x7ffa762983e2
16, Microsoft.CodeAnalysis.UserFunctionExtensions+<>c__DisplayClass3_0`2[[Microsoft.CodeAnalysis.SourceProductionContext, Microsoft.CodeAnalysis],[System.__Canon, mscorlib]].<WrapUserAction>b__0(Microsoft.CodeAnalysis.SourceProductionContext, System.__Canon) + 0x23 <-- 0x7ffa76298213
17, Microsoft.CodeAnalysis.SourceOutputNode`1[[System.__Canon, mscorlib]].UpdateStateTable(Builder, Microsoft.CodeAnalysis.NodeStateTable`1<System.ValueTuple`2<System.Collections.Generic.IEnumerable`1<Microsoft.CodeAnalysis.GeneratedSourceText>,System.Collections.Generic.IEnumerable`1<Microsoft.CodeAnalysis.Diagnostic>>>, System.Threading.CancellationToken) + 0x205 <-- 0x7ffa7627ff55
18, Microsoft.CodeAnalysis.DriverStateTable+Builder.GetLatestStateTableForNode[[System.ValueTuple`2[[System.__Canon, mscorlib],[System.__Canon, mscorlib]], mscorlib]](Microsoft.CodeAnalysis.IIncrementalGeneratorNode`1<System.ValueTuple`2<System.__Canon,System.__Canon>>) + 0x12e <-- 0x7ffa7627cdfe
19, Microsoft.CodeAnalysis.SourceOutputNode`1[[System.__Canon, mscorlib]].AppendOutputs(Microsoft.CodeAnalysis.IncrementalExecutionContext, System.Threading.CancellationToken) + 0x4d <-- 0x7ffa7627b8ad
20, Microsoft.CodeAnalysis.GeneratorDriver.RunGeneratorsCore(Microsoft.CodeAnalysis.Compilation, Microsoft.CodeAnalysis.DiagnosticBag, System.Threading.CancellationToken) + 0xb34 <-- 0x7ffa76276114
21, Microsoft.CodeAnalysis.SolutionState+CompilationTracker+<FinalizeCompilationAsync>d__30.MoveNext() + 0xd76 <-- 0x7ffa750e0d46
22, System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[Microsoft.CodeAnalysis.SolutionState+CompilationTracker+CompilationInfo, Microsoft.CodeAnalysis.Workspaces]].Start[[Microsoft.CodeAnalysis.SolutionState+CompilationTracker+<FinalizeCompilationAsync>d__30, Microsoft.CodeAnalysis.Workspaces]](<FinalizeCompilationAsync>d__30 ByRef) + 0x87 <-- 0x7ffa750df617
23, Microsoft.CodeAnalysis.SolutionState+CompilationTracker.FinalizeCompilationAsync(Microsoft.CodeAnalysis.SolutionState, Microsoft.CodeAnalysis.Compilation, System.Nullable`1<Microsoft.CodeAnalysis.TextDocumentStates`1<Microsoft.CodeAnalysis.SourceGeneratedDocumentState>>, Microsoft.CodeAnalysis.TextDocumentStates`1<Microsoft.CodeAnalysis.SourceGeneratedDocumentState>, Microsoft.CodeAnalysis.Compilation, Microsoft.CodeAnalysis.GeneratorDriver, System.Threading.CancellationToken) + 0xc4 <-- 0x7ffa750df3d4
24, Microsoft.CodeAnalysis.SolutionState+CompilationTracker.BuildCompilationInfoAsync(Microsoft.CodeAnalysis.SolutionState, System.Threading.CancellationToken) + 0x327 <-- Microsoft.CodeAnalysis.Workspaces.ni.dll+0x7dead7
25, Microsoft.CodeAnalysis.SolutionState+CompilationTracker+<GetOrBuildCompilationInfoAsync>d__22.MoveNext() + 0x4d3 <-- 0x7ffa750d8d23
26, System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[Microsoft.CodeAnalysis.SolutionState+CompilationTracker+CompilationInfo, Microsoft.CodeAnalysis.Workspaces]].Start[[Microsoft.CodeAnalysis.SolutionState+CompilationTracker+<GetOrBuildCompilationInfoAsync>d__22, Microsoft.CodeAnalysis.Workspaces]](<GetOrBuildCompilationInfoAsync>d__22 ByRef) + 0x87 <-- 0x7ffa750d8337
27, Microsoft.CodeAnalysis.SolutionState+CompilationTracker.GetOrBuildCompilationInfoAsync(Microsoft.CodeAnalysis.SolutionState, Boolean, System.Threading.CancellationToken) + 0x62 <-- Microsoft.CodeAnalysis.Workspaces.ni.dll+0x7de792
28, Microsoft.CodeAnalysis.SolutionState+CompilationTracker+<GetCompilationSlowAsync>d__20.MoveNext() + 0x6a <-- 0x7ffa750d805a
29, System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.__Canon, mscorlib]].Start[[Microsoft.CodeAnalysis.SolutionState+CompilationTracker+<GetCompilationSlowAsync>d__20, Microsoft.CodeAnalysis.Workspaces]](<GetCompilationSlowAsync>d__20 ByRef) + 0x81 <-- 0x7ffa750d7f81
30, Microsoft.CodeAnalysis.SolutionState+CompilationTracker.GetCompilationSlowAsync(Microsoft.CodeAnalysis.SolutionState, System.Threading.CancellationToken) + 0x5e <-- Microsoft.CodeAnalysis.Workspaces.ni.dll+0x7de70e
31, Microsoft.CodeAnalysis.SolutionState+CompilationTracker+<GetMetadataReferenceAsync>d__31.MoveNext() + 0x11c <-- 0x7ffa761e159c
32, System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.__Canon, mscorlib]].Start[[Microsoft.CodeAnalysis.SolutionState+CompilationTracker+<GetMetadataReferenceAsync>d__31, Microsoft.CodeAnalysis.Workspaces]](<GetMetadataReferenceAsync>d__31 ByRef) + 0x81 <-- 0x7ffa761e1411
33, Microsoft.CodeAnalysis.SolutionState+CompilationTracker.GetMetadataReferenceAsync(Microsoft.CodeAnalysis.SolutionState, Microsoft.CodeAnalysis.ProjectState, Microsoft.CodeAnalysis.ProjectReference, System.Threading.CancellationToken) + 0x73 <-- Microsoft.CodeAnalysis.Workspaces.ni.dll+0x7ded23
34, Microsoft.CodeAnalysis.SolutionState.GetMetadataReferenceAsync(Microsoft.CodeAnalysis.ProjectReference, Microsoft.CodeAnalysis.ProjectState, System.Threading.CancellationToken) + 0x4f <-- Microsoft.CodeAnalysis.Workspaces.ni.dll+0x7dc59f
35, Microsoft.CodeAnalysis.SolutionState+CompilationTracker+<FinalizeCompilationAsync>d__30.MoveNext() + 0x561 <-- 0x7ffa750e0531
36, System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[Microsoft.CodeAnalysis.SolutionState+CompilationTracker+CompilationInfo, Microsoft.CodeAnalysis.Workspaces]].Start[[Microsoft.CodeAnalysis.SolutionState+CompilationTracker+<FinalizeCompilationAsync>d__30, Microsoft.CodeAnalysis.Workspaces]](<FinalizeCompilationAsync>d__30 ByRef) + 0x87 <-- 0x7ffa750df617
37, Microsoft.CodeAnalysis.SolutionState+CompilationTracker.FinalizeCompilationAsync(Microsoft.CodeAnalysis.SolutionState, Microsoft.CodeAnalysis.Compilation, System.Nullable`1<Microsoft.CodeAnalysis.TextDocumentStates`1<Microsoft.CodeAnalysis.SourceGeneratedDocumentState>>, Microsoft.CodeAnalysis.TextDocumentStates`1<Microsoft.CodeAnalysis.SourceGeneratedDocumentState>, Microsoft.CodeAnalysis.Compilation, Microsoft.CodeAnalysis.GeneratorDriver, System.Threading.CancellationToken) + 0xc4 <-- 0x7ffa750df3d4
38, Microsoft.CodeAnalysis.SolutionState+CompilationTracker.BuildCompilationInfoAsync(Microsoft.CodeAnalysis.SolutionState, System.Threading.CancellationToken) + 0x327 <-- Microsoft.CodeAnalysis.Workspaces.ni.dll+0x7dead7
39, Microsoft.CodeAnalysis.SolutionState+CompilationTracker+<GetOrBuildCompilationInfoAsync>d__22.MoveNext() + 0x4d3 <-- 0x7ffa750d8d23
40, System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[Microsoft.CodeAnalysis.SolutionState+CompilationTracker+CompilationInfo, Microsoft.CodeAnalysis.Workspaces]].Start[[Microsoft.CodeAnalysis.SolutionState+CompilationTracker+<GetOrBuildCompilationInfoAsync>d__22, Microsoft.CodeAnalysis.Workspaces]](<GetOrBuildCompilationInfoAsync>d__22 ByRef) + 0x87 <-- 0x7ffa750d8337
41, Microsoft.CodeAnalysis.SolutionState+CompilationTracker.GetOrBuildCompilationInfoAsync(Microsoft.CodeAnalysis.SolutionState, Boolean, System.Threading.CancellationToken) + 0x62 <-- Microsoft.CodeAnalysis.Workspaces.ni.dll+0x7de792
42, Microsoft.CodeAnalysis.SolutionState+CompilationTracker+<GetCompilationSlowAsync>d__20.MoveNext() + 0x6a <-- 0x7ffa750d805a
43, System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.__Canon, mscorlib]].Start[[Microsoft.CodeAnalysis.SolutionState+CompilationTracker+<GetCompilationSlowAsync>d__20, Microsoft.CodeAnalysis.Workspaces]](<GetCompilationSlowAsync>d__20 ByRef) + 0x81 <-- 0x7ffa750d7f81
44, Microsoft.CodeAnalysis.SolutionState+CompilationTracker.GetCompilationSlowAsync(Microsoft.CodeAnalysis.SolutionState, System.Threading.CancellationToken) + 0x5e <-- Microsoft.CodeAnalysis.Workspaces.ni.dll+0x7de70e
45, Microsoft.CodeAnalysis.SolutionState+CompilationTracker+<GetMetadataReferenceAsync>d__31.MoveNext() + 0x11c <-- 0x7ffa761e159c
46, System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.__Canon, mscorlib]].Start[[Microsoft.CodeAnalysis.SolutionState+CompilationTracker+<GetMetadataReferenceAsync>d__31, Microsoft.CodeAnalysis.Workspaces]](<GetMetadataReferenceAsync>d__31 ByRef) + 0x81 <-- 0x7ffa761e1411
47, Microsoft.CodeAnalysis.SolutionState+CompilationTracker.GetMetadataReferenceAsync(Microsoft.CodeAnalysis.SolutionState, Microsoft.CodeAnalysis.ProjectState, Microsoft.CodeAnalysis.ProjectReference, System.Threading.CancellationToken) + 0x73 <-- Microsoft.CodeAnalysis.Workspaces.ni.dll+0x7ded23
48, Microsoft.CodeAnalysis.SolutionState.GetMetadataReferenceAsync(Microsoft.CodeAnalysis.ProjectReference, Microsoft.CodeAnalysis.ProjectState, System.Threading.CancellationToken) + 0x4f <-- Microsoft.CodeAnalysis.Workspaces.ni.dll+0x7dc59f
49, Microsoft.CodeAnalysis.SolutionState+CompilationTracker+<FinalizeCompilationAsync>d__30.MoveNext() + 0x561 <-- 0x7ffa750e0531
50, System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) + 0x172 <-- mscorlib.ni.dll+0x58df12
51, System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) + 0x15 <-- mscorlib.ni.dll+0x58dd95
52, System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run() + 0x6f <-- mscorlib.ni.dll+0x5fd00f
53, System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action, Boolean, System.Threading.Tasks.Task ByRef) + 0x63 <-- mscorlib.ni.dll+0x602523
54, System.Threading.Tasks.Task.FinishContinuations() + 0x400 <-- mscorlib.ni.dll+0x566f40
55, System.Threading.Tasks.Task`1[[System.__Canon, mscorlib]].TrySetResult(System.__Canon) + 0x68 <-- mscorlib.ni.dll+0x566a88
56, System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.__Canon, mscorlib]].SetResult(System.__Canon) + 0xa3 <-- mscorlib.ni.dll+0x5fc333
57, Microsoft.CodeAnalysis.SolutionState+CompilationTracker+<GetMetadataReferenceAsync>d__31.MoveNext() + 0x38b <-- 0x7ffa761e180b
58, System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) + 0x172 <-- mscorlib.ni.dll+0x58df12
59, System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) + 0x15 <-- mscorlib.ni.dll+0x58dd95
60, System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run() + 0x6f <-- mscorlib.ni.dll+0x5fd00f
61, System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action, Boolean, System.Threading.Tasks.Task ByRef) + 0x63 <-- mscorlib.ni.dll+0x602523
62, System.Threading.Tasks.Task.FinishContinuations() + 0x400 <-- mscorlib.ni.dll+0x566f40
63, System.Threading.Tasks.Task`1[[System.__Canon, mscorlib]].TrySetResult(System.__Canon) + 0x68 <-- mscorlib.ni.dll+0x566a88
64, System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.__Canon, mscorlib]].SetResult(System.__Canon) + 0xa3 <-- mscorlib.ni.dll+0x5fc333
65, Microsoft.CodeAnalysis.SolutionState+CompilationTracker+<GetCompilationSlowAsync>d__20.MoveNext() + 0x196 <-- 0x7ffa750d8186
66, System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) + 0x172 <-- mscorlib.ni.dll+0x58df12
67, System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) + 0x15 <-- mscorlib.ni.dll+0x58dd95
68, System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run() + 0x6f <-- mscorlib.ni.dll+0x5fd00f
69, System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action, Boolean, System.Threading.Tasks.Task ByRef) + 0x63 <-- mscorlib.ni.dll+0x602523
70, System.Threading.Tasks.Task.FinishContinuations() + 0x400 <-- mscorlib.ni.dll+0x566f40
71, System.Threading.Tasks.Task`1[[Microsoft.CodeAnalysis.SolutionState+CompilationTracker+CompilationInfo, Microsoft.CodeAnalysis.Workspaces]].TrySetResult(CompilationInfo) + 0x7d <-- 0x7ffa751bd5ed
72, System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[Microsoft.CodeAnalysis.SolutionState+CompilationTracker+CompilationInfo, Microsoft.CodeAnalysis.Workspaces]].SetResult(CompilationInfo) + 0xef <-- 0x7ffa750f705f
73, Microsoft.CodeAnalysis.SolutionState+CompilationTracker+<GetOrBuildCompilationInfoAsync>d__22.MoveNext() + 0x805 <-- 0x7ffa750d9055
74, System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) + 0x172 <-- mscorlib.ni.dll+0x58df12
75, System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) + 0x15 <-- mscorlib.ni.dll+0x58dd95
76, System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run() + 0x6f <-- mscorlib.ni.dll+0x5fd00f
77, System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action, Boolean, System.Threading.Tasks.Task ByRef) + 0x63 <-- mscorlib.ni.dll+0x602523
78, System.Threading.Tasks.Task.FinishContinuations() + 0x400 <-- mscorlib.ni.dll+0x566f40
79, System.Threading.Tasks.Task`1[[Microsoft.CodeAnalysis.SolutionState+CompilationTracker+CompilationInfo, Microsoft.CodeAnalysis.Workspaces]].TrySetResult(CompilationInfo) + 0x7d <-- 0x7ffa751bd5ed
80, System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[Microsoft.CodeAnalysis.SolutionState+CompilationTracker+CompilationInfo, Microsoft.CodeAnalysis.Workspaces]].SetResult(CompilationInfo) + 0xef <-- 0x7ffa750f705f
81, Microsoft.CodeAnalysis.SolutionState+CompilationTracker+<FinalizeCompilationAsync>d__30.MoveNext() + 0x175a <-- 0x7ffa750e172a
82, System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) + 0x172 <-- mscorlib.ni.dll+0x58df12
83, System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) + 0x15 <-- mscorlib.ni.dll+0x58dd95
84, System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run() + 0x6f <-- mscorlib.ni.dll+0x5fd00f
85, System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action, Boolean, System.Threading.Tasks.Task ByRef) + 0x63 <-- mscorlib.ni.dll+0x602523
86, System.Threading.Tasks.Task.FinishContinuations() + 0x400 <-- mscorlib.ni.dll+0x566f40
87, System.Threading.Tasks.Task`1[[System.__Canon, mscorlib]].TrySetResult(System.__Canon) + 0x68 <-- mscorlib.ni.dll+0x566a88
88, System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.__Canon, mscorlib]].SetResult(System.__Canon) + 0xa3 <-- mscorlib.ni.dll+0x5fc333
89, Microsoft.CodeAnalysis.SolutionState+CompilationTracker+<GetMetadataReferenceAsync>d__31.MoveNext() + 0x38b <-- 0x7ffa761e180b
90, System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) + 0x172 <-- mscorlib.ni.dll+0x58df12
91, System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) + 0x15 <-- mscorlib.ni.dll+0x58dd95
92, System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run() + 0x6f <-- mscorlib.ni.dll+0x5fd00f
93, System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action, Boolean, System.Threading.Tasks.Task ByRef) + 0x63 <-- mscorlib.ni.dll+0x602523
94, System.Threading.Tasks.Task.FinishContinuations() + 0x400 <-- mscorlib.ni.dll+0x566f40
95, System.Threading.Tasks.Task`1[[System.__Canon, mscorlib]].TrySetResult(System.__Canon) + 0x68 <-- mscorlib.ni.dll+0x566a88
96, System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.__Canon, mscorlib]].SetResult(System.__Canon) + 0xa3 <-- mscorlib.ni.dll+0x5fc333
97, Microsoft.CodeAnalysis.SolutionState+CompilationTracker+<GetCompilationSlowAsync>d__20.MoveNext() + 0x196 <-- 0x7ffa750d8186
98, System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) + 0x172 <-- mscorlib.ni.dll+0x58df12
99, System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) + 0x15 <-- mscorlib.ni.dll+0x58dd95
100, System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run() + 0x6f <-- mscorlib.ni.dll+0x5fd00f
101, System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action, Boolean, System.Threading.Tasks.Task ByRef) + 0x63 <-- mscorlib.ni.dll+0x602523
102, System.Threading.Tasks.Task.FinishContinuations() + 0x400 <-- mscorlib.ni.dll+0x566f40
103, System.Threading.Tasks.Task`1[[Microsoft.CodeAnalysis.SolutionState+CompilationTracker+CompilationInfo, Microsoft.CodeAnalysis.Workspaces]].TrySetResult(CompilationInfo) + 0x7d <-- 0x7ffa751bd5ed
104, System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[Microsoft.CodeAnalysis.SolutionState+CompilationTracker+CompilationInfo, Microsoft.CodeAnalysis.Workspaces]].SetResult(CompilationInfo) + 0xef <-- 0x7ffa750f705f
105, Microsoft.CodeAnalysis.SolutionState+CompilationTracker+<GetOrBuildCompilationInfoAsync>d__22.MoveNext() + 0x805 <-- 0x7ffa750d9055
106, System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) + 0x172 <-- mscorlib.ni.dll+0x58df12
107, System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) + 0x15 <-- mscorlib.ni.dll+0x58dd95
108, System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run() + 0x6f <-- mscorlib.ni.dll+0x5fd00f
109, System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action, Boolean, System.Threading.Tasks.Task ByRef) + 0x63 <-- mscorlib.ni.dll+0x602523
110, System.Threading.Tasks.Task.FinishContinuations() + 0x400 <-- mscorlib.ni.dll+0x566f40
111, System.Threading.Tasks.Task`1[[Roslyn.Utilities.SemaphoreSlimExtensions+SemaphoreDisposer, Microsoft.CodeAnalysis.Workspaces]].TrySetResult(SemaphoreDisposer) + 0x72 <-- 0x7ffa751bd542
112, System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[Roslyn.Utilities.SemaphoreSlimExtensions+SemaphoreDisposer, Microsoft.CodeAnalysis.Workspaces]].SetResult(SemaphoreDisposer) + 0xa3 <-- 0x7ffa751bd463
113, Roslyn.Utilities.SemaphoreSlimExtensions+<DisposableWaitAsync>d__1.MoveNext() + 0x177 <-- Microsoft.CodeAnalysis.Workspaces.ni.dll+0x7e3497
114, System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) + 0x172 <-- mscorlib.ni.dll+0x58df12
115, System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) + 0x15 <-- mscorlib.ni.dll+0x58dd95
116, System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run() + 0x6f <-- mscorlib.ni.dll+0x5fd00f
117, System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action, Boolean, System.Threading.Tasks.Task ByRef) + 0x63 <-- mscorlib.ni.dll+0x602523
118, System.Threading.Tasks.Task.FinishContinuations() + 0x400 <-- mscorlib.ni.dll+0x566f40
119, System.Threading.Tasks.Task`1[[System.Boolean, mscorlib]].TrySetResult(Boolean) + 0x5e <-- mscorlib.ni.dll+0x5aaf0e
120, System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.Boolean, mscorlib]].SetResult(Boolean) + 0x9f <-- mscorlib.ni.dll+0x5ab01f
121, System.Threading.SemaphoreSlim+<WaitUntilCountOrTimeoutAsync>d__31.MoveNext() + 0x442 <-- mscorlib.ni.dll+0x1010632
122, System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) + 0x172 <-- mscorlib.ni.dll+0x58df12
123, System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) + 0x15 <-- mscorlib.ni.dll+0x58dd95
124, System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run() + 0x6f <-- mscorlib.ni.dll+0x5fd00f
125, System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action, Boolean, System.Threading.Tasks.Task ByRef) + 0x63 <-- mscorlib.ni.dll+0x602523
126, System.Threading.Tasks.Task.FinishContinuations() + 0x400 <-- mscorlib.ni.dll+0x566f40
127, System.Threading.Tasks.Task`1[[System.__Canon, mscorlib]].TrySetResult(System.__Canon) + 0x68 <-- mscorlib.ni.dll+0x566a88
128, System.Threading.Tasks.TaskFactory+CompleteOnInvokePromise.Invoke(System.Threading.Tasks.Task) + 0xab <-- mscorlib.ni.dll+0x1014c1b
129, System.Threading.Tasks.Task.FinishContinuations() + 0x447 <-- mscorlib.ni.dll+0x566f87
130, System.Threading.Tasks.Task`1[[System.Boolean, mscorlib]].TrySetResult(Boolean) + 0x5e <-- mscorlib.ni.dll+0x5aaf0e
131, System.Threading.SemaphoreSlim+TaskNode.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem() + 0x10 <-- mscorlib.ni.dll+0x100f0a0
132, System.Threading.ThreadPoolWorkQueue.Dispatch() + 0x156 <-- mscorlib.ni.dll+0x558e46
133, clr.dll!CoUninitializeEE+0x1b93
134, clr.dll!CoUninitializeEE+0x1a98
135, clr.dll!CoUninitializeEE+0x2358
136, clr.dll!CoUninitializeEE+0x737a
137, clr.dll!CoUninitializeEE+0x2f50
138, clr.dll!CoUninitializeEE+0x2ec3
139, clr.dll!CoUninitializeEE+0x2e02
140, clr.dll!CoUninitializeEE+0x2fe7
141, clr.dll!CoUninitializeEE+0x72c7
142, clr.dll!CoUninitializeEE+0x2b17
143, clr.dll!CoUninitializeEE+0x29ef
144, clr.dll!CoUninitializeEE+0x6835
145, kernel32.dll!BaseThreadInitThunk+0x14
146, ntdll.dll!RtlUserThreadStart+0x21
0, ntoskrnl.exe!KeWaitForSingleObject+0x30c1
1, ntoskrnl.exe!KeSynchronizeExecution+0x2e02
2, ntoskrnl.exe!ExReleasePushLockSharedEx+0x66
3, ntoskrnl.exe!ExReleaseFastMutex+0x36
4, ntoskrnl.exe!CcUninitializeCacheMap+0x52e
5, ntoskrnl.exe!CcUnmapFileOffsetFromSystemCache+0x28
6, Ntfs.sys+0x1f805
7, Ntfs.sys+0xfa90a
8, Ntfs.sys+0x19171
9, Ntfs.sys+0xfab3b
10, Ntfs.sys+0x103a9e
11, Ntfs.sys+0xfeefd
12, ntoskrnl.exe!KeSynchronizeExecution+0x2447
13, ntoskrnl.exe!KeSynchronizeExecution+0x240d
14, ntoskrnl.exe!KeExpandKernelStackAndCalloutEx+0x36a
15, ntoskrnl.exe!KeExpandKernelStackAndCalloutEx+0x1ae
16, ntoskrnl.exe!KeExpandKernelStackAndCalloutEx+0x65
17, ntoskrnl.exe!KeExpandKernelStackAndCalloutEx+0x1d
18, Ntfs.sys+0xff17f
19, ntoskrnl.exe!IofCallDriver+0x59
20, FLTMGR.SYS!FltIsCallbackDataDirty+0x2e7
21, FLTMGR.SYS!FltQueryInformationFile+0x36d
22, ntoskrnl.exe!IofCallDriver+0x59
23, ntoskrnl.exe!SePrivilegeCheck+0x1233
24, ntoskrnl.exe!SeUnlockSubjectContext+0xdab
25, ntoskrnl.exe!ObOpenObjectByNameEx+0x1df
26, ntoskrnl.exe!NtCreateFile+0x485
27, ntoskrnl.exe!NtCreateFile+0x79
28, ntoskrnl.exe!setjmpex+0x6f03
29, ntdll.dll!ZwCreateFile+0x14
30, guard64.dll!Exported+0x185e3
31, KernelBase.dll!CreateFileW+0x378
32, KernelBase.dll!CreateFileW+0x66
33, clr.dll!StrongNameTokenFromPublicKey+0x1c2b
34, clr.dll!StrongNameTokenFromPublicKey+0xdbf9
35, clr.dll!StrongNameTokenFromPublicKey+0xdad0
36, clr.dll!StrongNameTokenFromPublicKey+0xd90f
37, clr.dll!LogHelp_NoGuiOnAssert+0x6fe38
38, clr.dll!CorExeMain+0x3e0ad
39, clr.dll!NGenCreateNGenWorker+0x2685
40, clr.dll!TranslateSecurityAttributes+0x1c1435
41, System.Reflection.AssemblyName.GetAssemblyName(System.String) + 0x6a <-- mscorlib.ni.dll+0x5a806a
42, System.Linq.Enumerable.ToDictionary[[System.__Canon, mscorlib],[System.__Canon, mscorlib],[System.__Canon, mscorlib]](System.Collections.Generic.IEnumerable`1<System.__Canon>, System.Func`2<System.__Canon,System.__Canon>, System.Func`2<System.__Canon,System.__Canon>, System.Collections.Generic.IEqualityComparer`1<System.__Canon>) + 0xfb <-- System.Core.ni.dll+0x34282b
43, System.Text.Json.SourceGeneration.Reflection.MetadataLoadContextInternal..ctor(Microsoft.CodeAnalysis.Compilation) + 0x197 <-- 0x7ffa768141c7
44, System.Text.Json.SourceGeneration.JsonSourceGenerator+Parser..ctor(Microsoft.CodeAnalysis.GeneratorExecutionContext ByRef) + 0xfd <-- 0x7ffa76813d4d
45, System.Text.Json.SourceGeneration.JsonSourceGenerator.Execute(Microsoft.CodeAnalysis.GeneratorExecutionContext) + 0x60 <-- 0x7ffa76813b20
46, Microsoft.CodeAnalysis.SourceGeneratorAdaptor.<Initialize>b__4_5(Microsoft.CodeAnalysis.SourceProductionContext, GeneratorContextBuilder) + 0xf2 <-- 0x7ffa762983e2
47, Microsoft.CodeAnalysis.UserFunctionExtensions+<>c__DisplayClass3_0`2[[Microsoft.CodeAnalysis.SourceProductionContext, Microsoft.CodeAnalysis],[System.__Canon, mscorlib]].<WrapUserAction>b__0(Microsoft.CodeAnalysis.SourceProductionContext, System.__Canon) + 0x23 <-- 0x7ffa76298213
48, Microsoft.CodeAnalysis.SourceOutputNode`1[[System.__Canon, mscorlib]].UpdateStateTable(Builder, Microsoft.CodeAnalysis.NodeStateTable`1<System.ValueTuple`2<System.Collections.Generic.IEnumerable`1<Microsoft.CodeAnalysis.GeneratedSourceText>,System.Collections.Generic.IEnumerable`1<Microsoft.CodeAnalysis.Diagnostic>>>, System.Threading.CancellationToken) + 0x205 <-- 0x7ffa7627ff55
49, Microsoft.CodeAnalysis.DriverStateTable+Builder.GetLatestStateTableForNode[[System.ValueTuple`2[[System.__Canon, mscorlib],[System.__Canon, mscorlib]], mscorlib]](Microsoft.CodeAnalysis.IIncrementalGeneratorNode`1<System.ValueTuple`2<System.__Canon,System.__Canon>>) + 0x12e <-- 0x7ffa7627cdfe
50, Microsoft.CodeAnalysis.SourceOutputNode`1[[System.__Canon, mscorlib]].AppendOutputs(Microsoft.CodeAnalysis.IncrementalExecutionContext, System.Threading.CancellationToken) + 0x4d <-- 0x7ffa7627b8ad
51, Microsoft.CodeAnalysis.GeneratorDriver.RunGeneratorsCore(Microsoft.CodeAnalysis.Compilation, Microsoft.CodeAnalysis.DiagnosticBag, System.Threading.CancellationToken) + 0xb34 <-- 0x7ffa76276114
52, Microsoft.CodeAnalysis.SolutionState+CompilationTracker+<FinalizeCompilationAsync>d__30.MoveNext() + 0xd76 <-- 0x7ffa750e0d46
53, System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[Microsoft.CodeAnalysis.SolutionState+CompilationTracker+CompilationInfo, Microsoft.CodeAnalysis.Workspaces]].Start[[Microsoft.CodeAnalysis.SolutionState+CompilationTracker+<FinalizeCompilationAsync>d__30, Microsoft.CodeAnalysis.Workspaces]](<FinalizeCompilationAsync>d__30 ByRef) + 0x87 <-- 0x7ffa750df617
54, Microsoft.CodeAnalysis.SolutionState+CompilationTracker.FinalizeCompilationAsync(Microsoft.CodeAnalysis.SolutionState, Microsoft.CodeAnalysis.Compilation, System.Nullable`1<Microsoft.CodeAnalysis.TextDocumentStates`1<Microsoft.CodeAnalysis.SourceGeneratedDocumentState>>, Microsoft.CodeAnalysis.TextDocumentStates`1<Microsoft.CodeAnalysis.SourceGeneratedDocumentState>, Microsoft.CodeAnalysis.Compilation, Microsoft.CodeAnalysis.GeneratorDriver, System.Threading.CancellationToken) + 0xc4 <-- 0x7ffa750df3d4
55, Microsoft.CodeAnalysis.SolutionState+CompilationTracker.BuildCompilationInfoAsync(Microsoft.CodeAnalysis.SolutionState, System.Threading.CancellationToken) + 0x327 <-- Microsoft.CodeAnalysis.Workspaces.ni.dll+0x7dead7
56, Microsoft.CodeAnalysis.SolutionState+CompilationTracker+<GetOrBuildCompilationInfoAsync>d__22.MoveNext() + 0x4d3 <-- 0x7ffa750d8d23
57, System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[Microsoft.CodeAnalysis.SolutionState+CompilationTracker+CompilationInfo, Microsoft.CodeAnalysis.Workspaces]].Start[[Microsoft.CodeAnalysis.SolutionState+CompilationTracker+<GetOrBuildCompilationInfoAsync>d__22, Microsoft.CodeAnalysis.Workspaces]](<GetOrBuildCompilationInfoAsync>d__22 ByRef) + 0x87 <-- 0x7ffa750d8337
58, Microsoft.CodeAnalysis.SolutionState+CompilationTracker.GetOrBuildCompilationInfoAsync(Microsoft.CodeAnalysis.SolutionState, Boolean, System.Threading.CancellationToken) + 0x62 <-- Microsoft.CodeAnalysis.Workspaces.ni.dll+0x7de792
59, Microsoft.CodeAnalysis.SolutionState+CompilationTracker+<GetCompilationSlowAsync>d__20.MoveNext() + 0x6a <-- 0x7ffa750d805a
60, System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.__Canon, mscorlib]].Start[[Microsoft.CodeAnalysis.SolutionState+CompilationTracker+<GetCompilationSlowAsync>d__20, Microsoft.CodeAnalysis.Workspaces]](<GetCompilationSlowAsync>d__20 ByRef) + 0x81 <-- 0x7ffa750d7f81
61, Microsoft.CodeAnalysis.SolutionState+CompilationTracker.GetCompilationSlowAsync(Microsoft.CodeAnalysis.SolutionState, System.Threading.CancellationToken) + 0x5e <-- Microsoft.CodeAnalysis.Workspaces.ni.dll+0x7de70e
62, Microsoft.CodeAnalysis.SolutionState+CompilationTracker.GetCompilationAsync(Microsoft.CodeAnalysis.SolutionState, System.Threading.CancellationToken) + 0x3c <-- Microsoft.CodeAnalysis.Workspaces.ni.dll+0x7de69c
63, Microsoft.CodeAnalysis.SolutionState.GetCompilationAsync(Microsoft.CodeAnalysis.ProjectState, System.Threading.CancellationToken) + 0x4e <-- Microsoft.CodeAnalysis.Workspaces.ni.dll+0x7dc4be
64, Microsoft.CodeAnalysis.Document+<GetSemanticModelAsync>d__23.MoveNext() + 0x2ee <-- Microsoft.CodeAnalysis.Workspaces.ni.dll+0x805b8e
65, System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.__Canon, mscorlib]].Start[[Microsoft.CodeAnalysis.Document+<GetSemanticModelAsync>d__23, Microsoft.CodeAnalysis.Workspaces]](<GetSemanticModelAsync>d__23 ByRef) + 0x81 <-- 0x7ffa750d55c1
66, Microsoft.CodeAnalysis.Document.GetSemanticModelAsync(System.Threading.CancellationToken) + 0x5c <-- Microsoft.CodeAnalysis.Workspaces.ni.dll+0x7fe17c
67, Microsoft.CodeAnalysis.Shared.Extensions.DocumentExtensions+<GetRequiredSemanticModelAsync>d__7.MoveNext() + 0x87 <-- 0x7ffa7595c997
68, System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.__Canon, mscorlib]].Start[[Microsoft.CodeAnalysis.Shared.Extensions.DocumentExtensions+<GetRequiredSemanticModelAsync>d__7, Microsoft.CodeAnalysis.Workspaces]](<GetRequiredSemanticModelAsync>d__7 ByRef) + 0x81 <-- 0x7ffa7595c8a1
69, Microsoft.CodeAnalysis.Shared.Extensions.DocumentExtensions.GetRequiredSemanticModelAsync(Microsoft.CodeAnalysis.Document, System.Threading.CancellationToken) + 0x69 <-- 0x7ffa7595c7d9
70, Microsoft.CodeAnalysis.InlineHints.AbstractInlineParameterNameHintsService+<GetInlineHintsAsync>d__2.MoveNext() + 0x853 <-- Microsoft.CodeAnalysis.Features.ni.dll+0x8406f3
71, System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.Collections.Immutable.ImmutableArray`1[[Microsoft.CodeAnalysis.InlineHints.InlineHint, Microsoft.CodeAnalysis.Features]], System.Collections.Immutable]].Start[[Microsoft.CodeAnalysis.InlineHints.AbstractInlineParameterNameHintsService+<GetInlineHintsAsync>d__2, Microsoft.CodeAnalysis.Features]](<GetInlineHintsAsync>d__2 ByRef) + 0x87 <-- 0x7ffa75a25cd7
72, Microsoft.CodeAnalysis.InlineHints.AbstractInlineParameterNameHintsService.GetInlineHintsAsync(Microsoft.CodeAnalysis.Document, Microsoft.CodeAnalysis.Text.TextSpan, System.Threading.CancellationToken) + 0x72 <-- Microsoft.CodeAnalysis.Features.ni.dll+0x8c8492
73, Microsoft.CodeAnalysis.InlineHints.AbstractInlineHintsService+<GetInlineHintsAsync>d__0.MoveNext() + 0xb0 <-- Microsoft.CodeAnalysis.Features.ni.dll+0x83fb90
74, System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.Collections.Immutable.ImmutableArray`1[[Microsoft.CodeAnalysis.InlineHints.InlineHint, Microsoft.CodeAnalysis.Features]], System.Collections.Immutable]].Start[[Microsoft.CodeAnalysis.InlineHints.AbstractInlineHintsService+<GetInlineHintsAsync>d__0, Microsoft.CodeAnalysis.Features]](<GetInlineHintsAsync>d__0 ByRef) + 0x87 <-- 0x7ffa75a25bd7
75, Microsoft.CodeAnalysis.InlineHints.AbstractInlineHintsService.GetInlineHintsAsync(Microsoft.CodeAnalysis.Document, Microsoft.CodeAnalysis.Text.TextSpan, System.Threading.CancellationToken) + 0x69 <-- Microsoft.CodeAnalysis.Features.ni.dll+0x8c8409
76, Microsoft.CodeAnalysis.Editor.InlineHints.InlineHintsDataTaggerProvider+<ProduceTagsAsync>d__10.MoveNext() + 0x12c <-- Microsoft.CodeAnalysis.EditorFeatures.ni.dll+0x24b6cc
77, System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[Microsoft.CodeAnalysis.Editor.InlineHints.InlineHintsDataTaggerProvider+<ProduceTagsAsync>d__10, Microsoft.CodeAnalysis.EditorFeatures]](<ProduceTagsAsync>d__10 ByRef) + 0x87 <-- 0x7ffa75a25857
78, Microsoft.CodeAnalysis.Editor.InlineHints.InlineHintsDataTaggerProvider.ProduceTagsAsync(Microsoft.CodeAnalysis.Editor.Tagging.TaggerContext`1<Microsoft.CodeAnalysis.Editor.InlineHints.InlineHintDataTag>, Microsoft.CodeAnalysis.Editor.DocumentSnapshotSpan, System.Nullable`1<Int32>) + 0x63 <-- Microsoft.CodeAnalysis.EditorFeatures.ni.dll+0x2204c3
79, Microsoft.CodeAnalysis.Editor.Tagging.AbstractAsynchronousTaggerProvider`1+<ProduceTagsAsync>d__26[[System.__Canon, mscorlib]].MoveNext() + 0x21d <-- Microsoft.CodeAnalysis.EditorFeatures.ni.dll+0x22c8fd
80, System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[Microsoft.CodeAnalysis.Editor.Tagging.AbstractAsynchronousTaggerProvider`1+<ProduceTagsAsync>d__26[[System.__Canon, mscorlib]], Microsoft.CodeAnalysis.EditorFeatures]](<ProduceTagsAsync>d__26<System.__Canon> ByRef) + 0xa4 <-- 0x7ffa7595a344
81, Microsoft.CodeAnalysis.Editor.Tagging.AbstractAsynchronousTaggerProvider`1[[System.__Canon, mscorlib]].ProduceTagsAsync(Microsoft.CodeAnalysis.Editor.Tagging.TaggerContext`1<System.__Canon>) + 0x79 <-- Microsoft.CodeAnalysis.EditorFeatures.ni.dll+0x210a29
82, Microsoft.CodeAnalysis.Editor.Tagging.AbstractAsynchronousTaggerProvider`1+TagSource+<RecomputeTagsForegroundAsync>d__38[[System.__Canon, mscorlib]].MoveNext() + 0x3a8 <-- Microsoft.CodeAnalysis.EditorFeatures.ni.dll+0x22bb18
83, System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) + 0x172 <-- mscorlib.ni.dll+0x58df12
84, System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) + 0x15 <-- mscorlib.ni.dll+0x58dd95
85, System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run() + 0x6f <-- mscorlib.ni.dll+0x5fd00f
86, System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem() + 0x41 <-- mscorlib.ni.dll+0x559bd1
87, System.Threading.ThreadPoolWorkQueue.Dispatch() + 0x156 <-- mscorlib.ni.dll+0x558e46
88, clr.dll!CoUninitializeEE+0x1b93
89, clr.dll!CoUninitializeEE+0x1a98
90, clr.dll!CoUninitializeEE+0x2358
91, clr.dll!CoUninitializeEE+0x737a
92, clr.dll!CoUninitializeEE+0x2f50
93, clr.dll!CoUninitializeEE+0x2ec3
94, clr.dll!CoUninitializeEE+0x2e02
95, clr.dll!CoUninitializeEE+0x2fe7
96, clr.dll!CoUninitializeEE+0x72c7
97, clr.dll!CoUninitializeEE+0x2b17
98, clr.dll!CoUninitializeEE+0x29ef
99, clr.dll!CoUninitializeEE+0x6835
100, kernel32.dll!BaseThreadInitThunk+0x14
101, ntdll.dll!RtlUserThreadStart+0x21

Evidence: Memory and Managed Heap Snapshots

When I attached another instance of VS to "debug" the problematic instance, and took managed heap snapshots, I noticed that the lion's share of allocated bytes was once again for types in Microsoft.CodeAnalysis. Some types had over a million instances! This was not the case prior to DotNet 6 Preview 5 and prior to Preview 5 VS 2019 was not running out of memory at all on the same solution.

Issue with Source Generators

Now, according to every stack trace that I took of VS's threads when it was misbehaving, it always involved Microsoft.CodeAnalysis.SourceGeneratedDocumentState and System.Text.Json.SourceGeneration types.

Also note that my solution does NOT use any source generators. And VS's option Text Editor > VB/C# > Advanced > Enable all features in opened files from source generators (experimental) is tuned OFF.

I presume it might have something to do with Source Generator support being automatically included for System.Text.Json starting with Preview 5 (a was noted in your blog post), and so obviously it is applicable to me as I am now on Preview 6.

Expected Behavior: VS 2019 does not run out of memory. VS 2019 and VS 2022 do not slow down and become sluggish after typing a few characters / words.

Actual Behavior: Both VS 2019 and 2022 are slowed down, with VS 2019 being slowed down to the point of being completely unusable (due to memory pressure and GC), while VS 2022 is usable but typing experience deteriorates very quickly and becomes often literally one or a few characters per second (i.e. >500ms pause after each character on average).

It does not seem to correlate with what file I edit (large or small), what text I edit (comment, type name, variable name, code), and which project the file comes from (one on which other projects in the solution depend, or the one on which no other projects depend).

dotnet-issue-labeler[bot] commented 3 years ago

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

jaredpar commented 3 years ago

Moving to dotnet/runtime as it appears to be an issue with the Json source generator.

@chsienki for monitoring as this may be a case where we can leverage the V2 APIs for IDE perf

ghost commented 3 years ago

Tagging subscribers to this area: @eiriktsarpalis, @layomia See info in area-owners.md if you want to be subscribed.

Issue Details
**Version Used**: Latest Official DotNet 6 Preview 6 Latest VS previews: VS 2019 16.11 Preview 3 and VS 2022 Preview 2 C#: 10 (`preview`, including `global using`s in a few places) **Steps to Reproduce**: VS typing performance quickly degrades (hangs, up to several seconds pauses between characters typing, etc.) after working with several `cs` files for like 20 minutes or more in the context of a medium-sized DotNet 6 Preview 6 solution with maybe 70 projects, each with ~ 10 to 500 files. It started with DotNet6 Preview 5, which made VS 2019 run out of memory pretty quickly (GC was happening so often, that basically after about 1 hour of typing in a few files, it became unusable due to constant GC pauses, and VS's Private Bytes being near 2.5GB). VS 2022 in this regard was very timely, but it did not improve things much. The performance is better compared with 2019, because GCs happen much more rarely and not as aggressively, but there are still very frequent hangs and slowdowns that happen more and more often as time goes on. This is actually happening while doing very mundane things - for example just editing a few 500-line files in an hour, perhaps renaming a few variables, etc. Nothing super-heavy like editing 100s of files, or refactoring whole namespaces, etc. So I investigated this and came to conclude that `Microsoft.CodeAnalysis` was always the culprit. **Evidence: Stack Traces** First, in both VS 2019 and 2022, when I was examining stack traces of VS's threads during slowdowns, I saw references to `Microsoft.CodeAnalysis.SourceGener*` types _all the time_: ``` 0, ntoskrnl.exe!KeWaitForSingleObject+0x30c1 1, ntoskrnl.exe!KeSynchronizeExecution+0x2e02 2, ntdll.dll!RtlAllocateHeap+0xca3 3, ntdll.dll!RtlAllocateHeap+0x16b 4, guard64.dll!Exported+0x1e20 5, clr.dll!CoUninitializeEE+0xa1a 6, clr.dll!CoUninitializeEE+0xb14 7, clr.dll!LogHelp_NoGuiOnAssert+0x6753a 8, clr.dll!LogHelp_NoGuiOnAssert+0x67b33 9, clr.dll!TranslateSecurityAttributes+0x1c13e7 10, System.Reflection.AssemblyName.GetAssemblyName(System.String) + 0x6a <-- mscorlib.ni.dll+0x5a806a 11, System.Linq.Enumerable.ToDictionary[[System.__Canon, mscorlib],[System.__Canon, mscorlib],[System.__Canon, mscorlib]](System.Collections.Generic.IEnumerable`1, System.Func`2, System.Func`2, System.Collections.Generic.IEqualityComparer`1) + 0xfb <-- System.Core.ni.dll+0x34282b 12, System.Text.Json.SourceGeneration.Reflection.MetadataLoadContextInternal..ctor(Microsoft.CodeAnalysis.Compilation) + 0x197 <-- 0x7ffa768141c7 13, System.Text.Json.SourceGeneration.JsonSourceGenerator+Parser..ctor(Microsoft.CodeAnalysis.GeneratorExecutionContext ByRef) + 0xfd <-- 0x7ffa76813d4d 14, System.Text.Json.SourceGeneration.JsonSourceGenerator.Execute(Microsoft.CodeAnalysis.GeneratorExecutionContext) + 0x60 <-- 0x7ffa76813b20 15, Microsoft.CodeAnalysis.SourceGeneratorAdaptor.b__4_5(Microsoft.CodeAnalysis.SourceProductionContext, GeneratorContextBuilder) + 0xf2 <-- 0x7ffa762983e2 16, Microsoft.CodeAnalysis.UserFunctionExtensions+<>c__DisplayClass3_0`2[[Microsoft.CodeAnalysis.SourceProductionContext, Microsoft.CodeAnalysis],[System.__Canon, mscorlib]].b__0(Microsoft.CodeAnalysis.SourceProductionContext, System.__Canon) + 0x23 <-- 0x7ffa76298213 17, Microsoft.CodeAnalysis.SourceOutputNode`1[[System.__Canon, mscorlib]].UpdateStateTable(Builder, Microsoft.CodeAnalysis.NodeStateTable`1,System.Collections.Generic.IEnumerable`1>>, System.Threading.CancellationToken) + 0x205 <-- 0x7ffa7627ff55 18, Microsoft.CodeAnalysis.DriverStateTable+Builder.GetLatestStateTableForNode[[System.ValueTuple`2[[System.__Canon, mscorlib],[System.__Canon, mscorlib]], mscorlib]](Microsoft.CodeAnalysis.IIncrementalGeneratorNode`1>) + 0x12e <-- 0x7ffa7627cdfe 19, Microsoft.CodeAnalysis.SourceOutputNode`1[[System.__Canon, mscorlib]].AppendOutputs(Microsoft.CodeAnalysis.IncrementalExecutionContext, System.Threading.CancellationToken) + 0x4d <-- 0x7ffa7627b8ad 20, Microsoft.CodeAnalysis.GeneratorDriver.RunGeneratorsCore(Microsoft.CodeAnalysis.Compilation, Microsoft.CodeAnalysis.DiagnosticBag, System.Threading.CancellationToken) + 0xb34 <-- 0x7ffa76276114 21, Microsoft.CodeAnalysis.SolutionState+CompilationTracker+d__30.MoveNext() + 0xd76 <-- 0x7ffa750e0d46 22, System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[Microsoft.CodeAnalysis.SolutionState+CompilationTracker+CompilationInfo, Microsoft.CodeAnalysis.Workspaces]].Start[[Microsoft.CodeAnalysis.SolutionState+CompilationTracker+d__30, Microsoft.CodeAnalysis.Workspaces]](d__30 ByRef) + 0x87 <-- 0x7ffa750df617 23, Microsoft.CodeAnalysis.SolutionState+CompilationTracker.FinalizeCompilationAsync(Microsoft.CodeAnalysis.SolutionState, Microsoft.CodeAnalysis.Compilation, System.Nullable`1>, Microsoft.CodeAnalysis.TextDocumentStates`1, Microsoft.CodeAnalysis.Compilation, Microsoft.CodeAnalysis.GeneratorDriver, System.Threading.CancellationToken) + 0xc4 <-- 0x7ffa750df3d4 24, Microsoft.CodeAnalysis.SolutionState+CompilationTracker.BuildCompilationInfoAsync(Microsoft.CodeAnalysis.SolutionState, System.Threading.CancellationToken) + 0x327 <-- Microsoft.CodeAnalysis.Workspaces.ni.dll+0x7dead7 25, Microsoft.CodeAnalysis.SolutionState+CompilationTracker+d__22.MoveNext() + 0x4d3 <-- 0x7ffa750d8d23 26, System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[Microsoft.CodeAnalysis.SolutionState+CompilationTracker+CompilationInfo, Microsoft.CodeAnalysis.Workspaces]].Start[[Microsoft.CodeAnalysis.SolutionState+CompilationTracker+d__22, Microsoft.CodeAnalysis.Workspaces]](d__22 ByRef) + 0x87 <-- 0x7ffa750d8337 27, Microsoft.CodeAnalysis.SolutionState+CompilationTracker.GetOrBuildCompilationInfoAsync(Microsoft.CodeAnalysis.SolutionState, Boolean, System.Threading.CancellationToken) + 0x62 <-- Microsoft.CodeAnalysis.Workspaces.ni.dll+0x7de792 28, Microsoft.CodeAnalysis.SolutionState+CompilationTracker+d__20.MoveNext() + 0x6a <-- 0x7ffa750d805a 29, System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.__Canon, mscorlib]].Start[[Microsoft.CodeAnalysis.SolutionState+CompilationTracker+d__20, Microsoft.CodeAnalysis.Workspaces]](d__20 ByRef) + 0x81 <-- 0x7ffa750d7f81 30, Microsoft.CodeAnalysis.SolutionState+CompilationTracker.GetCompilationSlowAsync(Microsoft.CodeAnalysis.SolutionState, System.Threading.CancellationToken) + 0x5e <-- Microsoft.CodeAnalysis.Workspaces.ni.dll+0x7de70e 31, Microsoft.CodeAnalysis.SolutionState+CompilationTracker+d__31.MoveNext() + 0x11c <-- 0x7ffa761e159c 32, System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.__Canon, mscorlib]].Start[[Microsoft.CodeAnalysis.SolutionState+CompilationTracker+d__31, Microsoft.CodeAnalysis.Workspaces]](d__31 ByRef) + 0x81 <-- 0x7ffa761e1411 33, Microsoft.CodeAnalysis.SolutionState+CompilationTracker.GetMetadataReferenceAsync(Microsoft.CodeAnalysis.SolutionState, Microsoft.CodeAnalysis.ProjectState, Microsoft.CodeAnalysis.ProjectReference, System.Threading.CancellationToken) + 0x73 <-- Microsoft.CodeAnalysis.Workspaces.ni.dll+0x7ded23 34, Microsoft.CodeAnalysis.SolutionState.GetMetadataReferenceAsync(Microsoft.CodeAnalysis.ProjectReference, Microsoft.CodeAnalysis.ProjectState, System.Threading.CancellationToken) + 0x4f <-- Microsoft.CodeAnalysis.Workspaces.ni.dll+0x7dc59f 35, Microsoft.CodeAnalysis.SolutionState+CompilationTracker+d__30.MoveNext() + 0x561 <-- 0x7ffa750e0531 36, System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[Microsoft.CodeAnalysis.SolutionState+CompilationTracker+CompilationInfo, Microsoft.CodeAnalysis.Workspaces]].Start[[Microsoft.CodeAnalysis.SolutionState+CompilationTracker+d__30, Microsoft.CodeAnalysis.Workspaces]](d__30 ByRef) + 0x87 <-- 0x7ffa750df617 37, Microsoft.CodeAnalysis.SolutionState+CompilationTracker.FinalizeCompilationAsync(Microsoft.CodeAnalysis.SolutionState, Microsoft.CodeAnalysis.Compilation, System.Nullable`1>, Microsoft.CodeAnalysis.TextDocumentStates`1, Microsoft.CodeAnalysis.Compilation, Microsoft.CodeAnalysis.GeneratorDriver, System.Threading.CancellationToken) + 0xc4 <-- 0x7ffa750df3d4 38, Microsoft.CodeAnalysis.SolutionState+CompilationTracker.BuildCompilationInfoAsync(Microsoft.CodeAnalysis.SolutionState, System.Threading.CancellationToken) + 0x327 <-- Microsoft.CodeAnalysis.Workspaces.ni.dll+0x7dead7 39, Microsoft.CodeAnalysis.SolutionState+CompilationTracker+d__22.MoveNext() + 0x4d3 <-- 0x7ffa750d8d23 40, System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[Microsoft.CodeAnalysis.SolutionState+CompilationTracker+CompilationInfo, Microsoft.CodeAnalysis.Workspaces]].Start[[Microsoft.CodeAnalysis.SolutionState+CompilationTracker+d__22, Microsoft.CodeAnalysis.Workspaces]](d__22 ByRef) + 0x87 <-- 0x7ffa750d8337 41, Microsoft.CodeAnalysis.SolutionState+CompilationTracker.GetOrBuildCompilationInfoAsync(Microsoft.CodeAnalysis.SolutionState, Boolean, System.Threading.CancellationToken) + 0x62 <-- Microsoft.CodeAnalysis.Workspaces.ni.dll+0x7de792 42, Microsoft.CodeAnalysis.SolutionState+CompilationTracker+d__20.MoveNext() + 0x6a <-- 0x7ffa750d805a 43, System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.__Canon, mscorlib]].Start[[Microsoft.CodeAnalysis.SolutionState+CompilationTracker+d__20, Microsoft.CodeAnalysis.Workspaces]](d__20 ByRef) + 0x81 <-- 0x7ffa750d7f81 44, Microsoft.CodeAnalysis.SolutionState+CompilationTracker.GetCompilationSlowAsync(Microsoft.CodeAnalysis.SolutionState, System.Threading.CancellationToken) + 0x5e <-- Microsoft.CodeAnalysis.Workspaces.ni.dll+0x7de70e 45, Microsoft.CodeAnalysis.SolutionState+CompilationTracker+d__31.MoveNext() + 0x11c <-- 0x7ffa761e159c 46, System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.__Canon, mscorlib]].Start[[Microsoft.CodeAnalysis.SolutionState+CompilationTracker+d__31, Microsoft.CodeAnalysis.Workspaces]](d__31 ByRef) + 0x81 <-- 0x7ffa761e1411 47, Microsoft.CodeAnalysis.SolutionState+CompilationTracker.GetMetadataReferenceAsync(Microsoft.CodeAnalysis.SolutionState, Microsoft.CodeAnalysis.ProjectState, Microsoft.CodeAnalysis.ProjectReference, System.Threading.CancellationToken) + 0x73 <-- Microsoft.CodeAnalysis.Workspaces.ni.dll+0x7ded23 48, Microsoft.CodeAnalysis.SolutionState.GetMetadataReferenceAsync(Microsoft.CodeAnalysis.ProjectReference, Microsoft.CodeAnalysis.ProjectState, System.Threading.CancellationToken) + 0x4f <-- Microsoft.CodeAnalysis.Workspaces.ni.dll+0x7dc59f 49, Microsoft.CodeAnalysis.SolutionState+CompilationTracker+d__30.MoveNext() + 0x561 <-- 0x7ffa750e0531 50, System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) + 0x172 <-- mscorlib.ni.dll+0x58df12 51, System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) + 0x15 <-- mscorlib.ni.dll+0x58dd95 52, System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run() + 0x6f <-- mscorlib.ni.dll+0x5fd00f 53, System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action, Boolean, System.Threading.Tasks.Task ByRef) + 0x63 <-- mscorlib.ni.dll+0x602523 54, System.Threading.Tasks.Task.FinishContinuations() + 0x400 <-- mscorlib.ni.dll+0x566f40 55, System.Threading.Tasks.Task`1[[System.__Canon, mscorlib]].TrySetResult(System.__Canon) + 0x68 <-- mscorlib.ni.dll+0x566a88 56, System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.__Canon, mscorlib]].SetResult(System.__Canon) + 0xa3 <-- mscorlib.ni.dll+0x5fc333 57, Microsoft.CodeAnalysis.SolutionState+CompilationTracker+d__31.MoveNext() + 0x38b <-- 0x7ffa761e180b 58, System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) + 0x172 <-- mscorlib.ni.dll+0x58df12 59, System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) + 0x15 <-- mscorlib.ni.dll+0x58dd95 60, System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run() + 0x6f <-- mscorlib.ni.dll+0x5fd00f 61, System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action, Boolean, System.Threading.Tasks.Task ByRef) + 0x63 <-- mscorlib.ni.dll+0x602523 62, System.Threading.Tasks.Task.FinishContinuations() + 0x400 <-- mscorlib.ni.dll+0x566f40 63, System.Threading.Tasks.Task`1[[System.__Canon, mscorlib]].TrySetResult(System.__Canon) + 0x68 <-- mscorlib.ni.dll+0x566a88 64, System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.__Canon, mscorlib]].SetResult(System.__Canon) + 0xa3 <-- mscorlib.ni.dll+0x5fc333 65, Microsoft.CodeAnalysis.SolutionState+CompilationTracker+d__20.MoveNext() + 0x196 <-- 0x7ffa750d8186 66, System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) + 0x172 <-- mscorlib.ni.dll+0x58df12 67, System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) + 0x15 <-- mscorlib.ni.dll+0x58dd95 68, System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run() + 0x6f <-- mscorlib.ni.dll+0x5fd00f 69, System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action, Boolean, System.Threading.Tasks.Task ByRef) + 0x63 <-- mscorlib.ni.dll+0x602523 70, System.Threading.Tasks.Task.FinishContinuations() + 0x400 <-- mscorlib.ni.dll+0x566f40 71, System.Threading.Tasks.Task`1[[Microsoft.CodeAnalysis.SolutionState+CompilationTracker+CompilationInfo, Microsoft.CodeAnalysis.Workspaces]].TrySetResult(CompilationInfo) + 0x7d <-- 0x7ffa751bd5ed 72, System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[Microsoft.CodeAnalysis.SolutionState+CompilationTracker+CompilationInfo, Microsoft.CodeAnalysis.Workspaces]].SetResult(CompilationInfo) + 0xef <-- 0x7ffa750f705f 73, Microsoft.CodeAnalysis.SolutionState+CompilationTracker+d__22.MoveNext() + 0x805 <-- 0x7ffa750d9055 74, System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) + 0x172 <-- mscorlib.ni.dll+0x58df12 75, System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) + 0x15 <-- mscorlib.ni.dll+0x58dd95 76, System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run() + 0x6f <-- mscorlib.ni.dll+0x5fd00f 77, System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action, Boolean, System.Threading.Tasks.Task ByRef) + 0x63 <-- mscorlib.ni.dll+0x602523 78, System.Threading.Tasks.Task.FinishContinuations() + 0x400 <-- mscorlib.ni.dll+0x566f40 79, System.Threading.Tasks.Task`1[[Microsoft.CodeAnalysis.SolutionState+CompilationTracker+CompilationInfo, Microsoft.CodeAnalysis.Workspaces]].TrySetResult(CompilationInfo) + 0x7d <-- 0x7ffa751bd5ed 80, System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[Microsoft.CodeAnalysis.SolutionState+CompilationTracker+CompilationInfo, Microsoft.CodeAnalysis.Workspaces]].SetResult(CompilationInfo) + 0xef <-- 0x7ffa750f705f 81, Microsoft.CodeAnalysis.SolutionState+CompilationTracker+d__30.MoveNext() + 0x175a <-- 0x7ffa750e172a 82, System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) + 0x172 <-- mscorlib.ni.dll+0x58df12 83, System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) + 0x15 <-- mscorlib.ni.dll+0x58dd95 84, System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run() + 0x6f <-- mscorlib.ni.dll+0x5fd00f 85, System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action, Boolean, System.Threading.Tasks.Task ByRef) + 0x63 <-- mscorlib.ni.dll+0x602523 86, System.Threading.Tasks.Task.FinishContinuations() + 0x400 <-- mscorlib.ni.dll+0x566f40 87, System.Threading.Tasks.Task`1[[System.__Canon, mscorlib]].TrySetResult(System.__Canon) + 0x68 <-- mscorlib.ni.dll+0x566a88 88, System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.__Canon, mscorlib]].SetResult(System.__Canon) + 0xa3 <-- mscorlib.ni.dll+0x5fc333 89, Microsoft.CodeAnalysis.SolutionState+CompilationTracker+d__31.MoveNext() + 0x38b <-- 0x7ffa761e180b 90, System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) + 0x172 <-- mscorlib.ni.dll+0x58df12 91, System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) + 0x15 <-- mscorlib.ni.dll+0x58dd95 92, System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run() + 0x6f <-- mscorlib.ni.dll+0x5fd00f 93, System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action, Boolean, System.Threading.Tasks.Task ByRef) + 0x63 <-- mscorlib.ni.dll+0x602523 94, System.Threading.Tasks.Task.FinishContinuations() + 0x400 <-- mscorlib.ni.dll+0x566f40 95, System.Threading.Tasks.Task`1[[System.__Canon, mscorlib]].TrySetResult(System.__Canon) + 0x68 <-- mscorlib.ni.dll+0x566a88 96, System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.__Canon, mscorlib]].SetResult(System.__Canon) + 0xa3 <-- mscorlib.ni.dll+0x5fc333 97, Microsoft.CodeAnalysis.SolutionState+CompilationTracker+d__20.MoveNext() + 0x196 <-- 0x7ffa750d8186 98, System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) + 0x172 <-- mscorlib.ni.dll+0x58df12 99, System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) + 0x15 <-- mscorlib.ni.dll+0x58dd95 100, System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run() + 0x6f <-- mscorlib.ni.dll+0x5fd00f 101, System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action, Boolean, System.Threading.Tasks.Task ByRef) + 0x63 <-- mscorlib.ni.dll+0x602523 102, System.Threading.Tasks.Task.FinishContinuations() + 0x400 <-- mscorlib.ni.dll+0x566f40 103, System.Threading.Tasks.Task`1[[Microsoft.CodeAnalysis.SolutionState+CompilationTracker+CompilationInfo, Microsoft.CodeAnalysis.Workspaces]].TrySetResult(CompilationInfo) + 0x7d <-- 0x7ffa751bd5ed 104, System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[Microsoft.CodeAnalysis.SolutionState+CompilationTracker+CompilationInfo, Microsoft.CodeAnalysis.Workspaces]].SetResult(CompilationInfo) + 0xef <-- 0x7ffa750f705f 105, Microsoft.CodeAnalysis.SolutionState+CompilationTracker+d__22.MoveNext() + 0x805 <-- 0x7ffa750d9055 106, System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) + 0x172 <-- mscorlib.ni.dll+0x58df12 107, System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) + 0x15 <-- mscorlib.ni.dll+0x58dd95 108, System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run() + 0x6f <-- mscorlib.ni.dll+0x5fd00f 109, System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action, Boolean, System.Threading.Tasks.Task ByRef) + 0x63 <-- mscorlib.ni.dll+0x602523 110, System.Threading.Tasks.Task.FinishContinuations() + 0x400 <-- mscorlib.ni.dll+0x566f40 111, System.Threading.Tasks.Task`1[[Roslyn.Utilities.SemaphoreSlimExtensions+SemaphoreDisposer, Microsoft.CodeAnalysis.Workspaces]].TrySetResult(SemaphoreDisposer) + 0x72 <-- 0x7ffa751bd542 112, System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[Roslyn.Utilities.SemaphoreSlimExtensions+SemaphoreDisposer, Microsoft.CodeAnalysis.Workspaces]].SetResult(SemaphoreDisposer) + 0xa3 <-- 0x7ffa751bd463 113, Roslyn.Utilities.SemaphoreSlimExtensions+d__1.MoveNext() + 0x177 <-- Microsoft.CodeAnalysis.Workspaces.ni.dll+0x7e3497 114, System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) + 0x172 <-- mscorlib.ni.dll+0x58df12 115, System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) + 0x15 <-- mscorlib.ni.dll+0x58dd95 116, System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run() + 0x6f <-- mscorlib.ni.dll+0x5fd00f 117, System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action, Boolean, System.Threading.Tasks.Task ByRef) + 0x63 <-- mscorlib.ni.dll+0x602523 118, System.Threading.Tasks.Task.FinishContinuations() + 0x400 <-- mscorlib.ni.dll+0x566f40 119, System.Threading.Tasks.Task`1[[System.Boolean, mscorlib]].TrySetResult(Boolean) + 0x5e <-- mscorlib.ni.dll+0x5aaf0e 120, System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.Boolean, mscorlib]].SetResult(Boolean) + 0x9f <-- mscorlib.ni.dll+0x5ab01f 121, System.Threading.SemaphoreSlim+d__31.MoveNext() + 0x442 <-- mscorlib.ni.dll+0x1010632 122, System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) + 0x172 <-- mscorlib.ni.dll+0x58df12 123, System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) + 0x15 <-- mscorlib.ni.dll+0x58dd95 124, System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run() + 0x6f <-- mscorlib.ni.dll+0x5fd00f 125, System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action, Boolean, System.Threading.Tasks.Task ByRef) + 0x63 <-- mscorlib.ni.dll+0x602523 126, System.Threading.Tasks.Task.FinishContinuations() + 0x400 <-- mscorlib.ni.dll+0x566f40 127, System.Threading.Tasks.Task`1[[System.__Canon, mscorlib]].TrySetResult(System.__Canon) + 0x68 <-- mscorlib.ni.dll+0x566a88 128, System.Threading.Tasks.TaskFactory+CompleteOnInvokePromise.Invoke(System.Threading.Tasks.Task) + 0xab <-- mscorlib.ni.dll+0x1014c1b 129, System.Threading.Tasks.Task.FinishContinuations() + 0x447 <-- mscorlib.ni.dll+0x566f87 130, System.Threading.Tasks.Task`1[[System.Boolean, mscorlib]].TrySetResult(Boolean) + 0x5e <-- mscorlib.ni.dll+0x5aaf0e 131, System.Threading.SemaphoreSlim+TaskNode.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem() + 0x10 <-- mscorlib.ni.dll+0x100f0a0 132, System.Threading.ThreadPoolWorkQueue.Dispatch() + 0x156 <-- mscorlib.ni.dll+0x558e46 133, clr.dll!CoUninitializeEE+0x1b93 134, clr.dll!CoUninitializeEE+0x1a98 135, clr.dll!CoUninitializeEE+0x2358 136, clr.dll!CoUninitializeEE+0x737a 137, clr.dll!CoUninitializeEE+0x2f50 138, clr.dll!CoUninitializeEE+0x2ec3 139, clr.dll!CoUninitializeEE+0x2e02 140, clr.dll!CoUninitializeEE+0x2fe7 141, clr.dll!CoUninitializeEE+0x72c7 142, clr.dll!CoUninitializeEE+0x2b17 143, clr.dll!CoUninitializeEE+0x29ef 144, clr.dll!CoUninitializeEE+0x6835 145, kernel32.dll!BaseThreadInitThunk+0x14 146, ntdll.dll!RtlUserThreadStart+0x21 ``` ``` 0, ntoskrnl.exe!KeWaitForSingleObject+0x30c1 1, ntoskrnl.exe!KeSynchronizeExecution+0x2e02 2, ntoskrnl.exe!ExReleasePushLockSharedEx+0x66 3, ntoskrnl.exe!ExReleaseFastMutex+0x36 4, ntoskrnl.exe!CcUninitializeCacheMap+0x52e 5, ntoskrnl.exe!CcUnmapFileOffsetFromSystemCache+0x28 6, Ntfs.sys+0x1f805 7, Ntfs.sys+0xfa90a 8, Ntfs.sys+0x19171 9, Ntfs.sys+0xfab3b 10, Ntfs.sys+0x103a9e 11, Ntfs.sys+0xfeefd 12, ntoskrnl.exe!KeSynchronizeExecution+0x2447 13, ntoskrnl.exe!KeSynchronizeExecution+0x240d 14, ntoskrnl.exe!KeExpandKernelStackAndCalloutEx+0x36a 15, ntoskrnl.exe!KeExpandKernelStackAndCalloutEx+0x1ae 16, ntoskrnl.exe!KeExpandKernelStackAndCalloutEx+0x65 17, ntoskrnl.exe!KeExpandKernelStackAndCalloutEx+0x1d 18, Ntfs.sys+0xff17f 19, ntoskrnl.exe!IofCallDriver+0x59 20, FLTMGR.SYS!FltIsCallbackDataDirty+0x2e7 21, FLTMGR.SYS!FltQueryInformationFile+0x36d 22, ntoskrnl.exe!IofCallDriver+0x59 23, ntoskrnl.exe!SePrivilegeCheck+0x1233 24, ntoskrnl.exe!SeUnlockSubjectContext+0xdab 25, ntoskrnl.exe!ObOpenObjectByNameEx+0x1df 26, ntoskrnl.exe!NtCreateFile+0x485 27, ntoskrnl.exe!NtCreateFile+0x79 28, ntoskrnl.exe!setjmpex+0x6f03 29, ntdll.dll!ZwCreateFile+0x14 30, guard64.dll!Exported+0x185e3 31, KernelBase.dll!CreateFileW+0x378 32, KernelBase.dll!CreateFileW+0x66 33, clr.dll!StrongNameTokenFromPublicKey+0x1c2b 34, clr.dll!StrongNameTokenFromPublicKey+0xdbf9 35, clr.dll!StrongNameTokenFromPublicKey+0xdad0 36, clr.dll!StrongNameTokenFromPublicKey+0xd90f 37, clr.dll!LogHelp_NoGuiOnAssert+0x6fe38 38, clr.dll!CorExeMain+0x3e0ad 39, clr.dll!NGenCreateNGenWorker+0x2685 40, clr.dll!TranslateSecurityAttributes+0x1c1435 41, System.Reflection.AssemblyName.GetAssemblyName(System.String) + 0x6a <-- mscorlib.ni.dll+0x5a806a 42, System.Linq.Enumerable.ToDictionary[[System.__Canon, mscorlib],[System.__Canon, mscorlib],[System.__Canon, mscorlib]](System.Collections.Generic.IEnumerable`1, System.Func`2, System.Func`2, System.Collections.Generic.IEqualityComparer`1) + 0xfb <-- System.Core.ni.dll+0x34282b 43, System.Text.Json.SourceGeneration.Reflection.MetadataLoadContextInternal..ctor(Microsoft.CodeAnalysis.Compilation) + 0x197 <-- 0x7ffa768141c7 44, System.Text.Json.SourceGeneration.JsonSourceGenerator+Parser..ctor(Microsoft.CodeAnalysis.GeneratorExecutionContext ByRef) + 0xfd <-- 0x7ffa76813d4d 45, System.Text.Json.SourceGeneration.JsonSourceGenerator.Execute(Microsoft.CodeAnalysis.GeneratorExecutionContext) + 0x60 <-- 0x7ffa76813b20 46, Microsoft.CodeAnalysis.SourceGeneratorAdaptor.b__4_5(Microsoft.CodeAnalysis.SourceProductionContext, GeneratorContextBuilder) + 0xf2 <-- 0x7ffa762983e2 47, Microsoft.CodeAnalysis.UserFunctionExtensions+<>c__DisplayClass3_0`2[[Microsoft.CodeAnalysis.SourceProductionContext, Microsoft.CodeAnalysis],[System.__Canon, mscorlib]].b__0(Microsoft.CodeAnalysis.SourceProductionContext, System.__Canon) + 0x23 <-- 0x7ffa76298213 48, Microsoft.CodeAnalysis.SourceOutputNode`1[[System.__Canon, mscorlib]].UpdateStateTable(Builder, Microsoft.CodeAnalysis.NodeStateTable`1,System.Collections.Generic.IEnumerable`1>>, System.Threading.CancellationToken) + 0x205 <-- 0x7ffa7627ff55 49, Microsoft.CodeAnalysis.DriverStateTable+Builder.GetLatestStateTableForNode[[System.ValueTuple`2[[System.__Canon, mscorlib],[System.__Canon, mscorlib]], mscorlib]](Microsoft.CodeAnalysis.IIncrementalGeneratorNode`1>) + 0x12e <-- 0x7ffa7627cdfe 50, Microsoft.CodeAnalysis.SourceOutputNode`1[[System.__Canon, mscorlib]].AppendOutputs(Microsoft.CodeAnalysis.IncrementalExecutionContext, System.Threading.CancellationToken) + 0x4d <-- 0x7ffa7627b8ad 51, Microsoft.CodeAnalysis.GeneratorDriver.RunGeneratorsCore(Microsoft.CodeAnalysis.Compilation, Microsoft.CodeAnalysis.DiagnosticBag, System.Threading.CancellationToken) + 0xb34 <-- 0x7ffa76276114 52, Microsoft.CodeAnalysis.SolutionState+CompilationTracker+d__30.MoveNext() + 0xd76 <-- 0x7ffa750e0d46 53, System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[Microsoft.CodeAnalysis.SolutionState+CompilationTracker+CompilationInfo, Microsoft.CodeAnalysis.Workspaces]].Start[[Microsoft.CodeAnalysis.SolutionState+CompilationTracker+d__30, Microsoft.CodeAnalysis.Workspaces]](d__30 ByRef) + 0x87 <-- 0x7ffa750df617 54, Microsoft.CodeAnalysis.SolutionState+CompilationTracker.FinalizeCompilationAsync(Microsoft.CodeAnalysis.SolutionState, Microsoft.CodeAnalysis.Compilation, System.Nullable`1>, Microsoft.CodeAnalysis.TextDocumentStates`1, Microsoft.CodeAnalysis.Compilation, Microsoft.CodeAnalysis.GeneratorDriver, System.Threading.CancellationToken) + 0xc4 <-- 0x7ffa750df3d4 55, Microsoft.CodeAnalysis.SolutionState+CompilationTracker.BuildCompilationInfoAsync(Microsoft.CodeAnalysis.SolutionState, System.Threading.CancellationToken) + 0x327 <-- Microsoft.CodeAnalysis.Workspaces.ni.dll+0x7dead7 56, Microsoft.CodeAnalysis.SolutionState+CompilationTracker+d__22.MoveNext() + 0x4d3 <-- 0x7ffa750d8d23 57, System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[Microsoft.CodeAnalysis.SolutionState+CompilationTracker+CompilationInfo, Microsoft.CodeAnalysis.Workspaces]].Start[[Microsoft.CodeAnalysis.SolutionState+CompilationTracker+d__22, Microsoft.CodeAnalysis.Workspaces]](d__22 ByRef) + 0x87 <-- 0x7ffa750d8337 58, Microsoft.CodeAnalysis.SolutionState+CompilationTracker.GetOrBuildCompilationInfoAsync(Microsoft.CodeAnalysis.SolutionState, Boolean, System.Threading.CancellationToken) + 0x62 <-- Microsoft.CodeAnalysis.Workspaces.ni.dll+0x7de792 59, Microsoft.CodeAnalysis.SolutionState+CompilationTracker+d__20.MoveNext() + 0x6a <-- 0x7ffa750d805a 60, System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.__Canon, mscorlib]].Start[[Microsoft.CodeAnalysis.SolutionState+CompilationTracker+d__20, Microsoft.CodeAnalysis.Workspaces]](d__20 ByRef) + 0x81 <-- 0x7ffa750d7f81 61, Microsoft.CodeAnalysis.SolutionState+CompilationTracker.GetCompilationSlowAsync(Microsoft.CodeAnalysis.SolutionState, System.Threading.CancellationToken) + 0x5e <-- Microsoft.CodeAnalysis.Workspaces.ni.dll+0x7de70e 62, Microsoft.CodeAnalysis.SolutionState+CompilationTracker.GetCompilationAsync(Microsoft.CodeAnalysis.SolutionState, System.Threading.CancellationToken) + 0x3c <-- Microsoft.CodeAnalysis.Workspaces.ni.dll+0x7de69c 63, Microsoft.CodeAnalysis.SolutionState.GetCompilationAsync(Microsoft.CodeAnalysis.ProjectState, System.Threading.CancellationToken) + 0x4e <-- Microsoft.CodeAnalysis.Workspaces.ni.dll+0x7dc4be 64, Microsoft.CodeAnalysis.Document+d__23.MoveNext() + 0x2ee <-- Microsoft.CodeAnalysis.Workspaces.ni.dll+0x805b8e 65, System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.__Canon, mscorlib]].Start[[Microsoft.CodeAnalysis.Document+d__23, Microsoft.CodeAnalysis.Workspaces]](d__23 ByRef) + 0x81 <-- 0x7ffa750d55c1 66, Microsoft.CodeAnalysis.Document.GetSemanticModelAsync(System.Threading.CancellationToken) + 0x5c <-- Microsoft.CodeAnalysis.Workspaces.ni.dll+0x7fe17c 67, Microsoft.CodeAnalysis.Shared.Extensions.DocumentExtensions+d__7.MoveNext() + 0x87 <-- 0x7ffa7595c997 68, System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.__Canon, mscorlib]].Start[[Microsoft.CodeAnalysis.Shared.Extensions.DocumentExtensions+d__7, Microsoft.CodeAnalysis.Workspaces]](d__7 ByRef) + 0x81 <-- 0x7ffa7595c8a1 69, Microsoft.CodeAnalysis.Shared.Extensions.DocumentExtensions.GetRequiredSemanticModelAsync(Microsoft.CodeAnalysis.Document, System.Threading.CancellationToken) + 0x69 <-- 0x7ffa7595c7d9 70, Microsoft.CodeAnalysis.InlineHints.AbstractInlineParameterNameHintsService+d__2.MoveNext() + 0x853 <-- Microsoft.CodeAnalysis.Features.ni.dll+0x8406f3 71, System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.Collections.Immutable.ImmutableArray`1[[Microsoft.CodeAnalysis.InlineHints.InlineHint, Microsoft.CodeAnalysis.Features]], System.Collections.Immutable]].Start[[Microsoft.CodeAnalysis.InlineHints.AbstractInlineParameterNameHintsService+d__2, Microsoft.CodeAnalysis.Features]](d__2 ByRef) + 0x87 <-- 0x7ffa75a25cd7 72, Microsoft.CodeAnalysis.InlineHints.AbstractInlineParameterNameHintsService.GetInlineHintsAsync(Microsoft.CodeAnalysis.Document, Microsoft.CodeAnalysis.Text.TextSpan, System.Threading.CancellationToken) + 0x72 <-- Microsoft.CodeAnalysis.Features.ni.dll+0x8c8492 73, Microsoft.CodeAnalysis.InlineHints.AbstractInlineHintsService+d__0.MoveNext() + 0xb0 <-- Microsoft.CodeAnalysis.Features.ni.dll+0x83fb90 74, System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.Collections.Immutable.ImmutableArray`1[[Microsoft.CodeAnalysis.InlineHints.InlineHint, Microsoft.CodeAnalysis.Features]], System.Collections.Immutable]].Start[[Microsoft.CodeAnalysis.InlineHints.AbstractInlineHintsService+d__0, Microsoft.CodeAnalysis.Features]](d__0 ByRef) + 0x87 <-- 0x7ffa75a25bd7 75, Microsoft.CodeAnalysis.InlineHints.AbstractInlineHintsService.GetInlineHintsAsync(Microsoft.CodeAnalysis.Document, Microsoft.CodeAnalysis.Text.TextSpan, System.Threading.CancellationToken) + 0x69 <-- Microsoft.CodeAnalysis.Features.ni.dll+0x8c8409 76, Microsoft.CodeAnalysis.Editor.InlineHints.InlineHintsDataTaggerProvider+d__10.MoveNext() + 0x12c <-- Microsoft.CodeAnalysis.EditorFeatures.ni.dll+0x24b6cc 77, System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[Microsoft.CodeAnalysis.Editor.InlineHints.InlineHintsDataTaggerProvider+d__10, Microsoft.CodeAnalysis.EditorFeatures]](d__10 ByRef) + 0x87 <-- 0x7ffa75a25857 78, Microsoft.CodeAnalysis.Editor.InlineHints.InlineHintsDataTaggerProvider.ProduceTagsAsync(Microsoft.CodeAnalysis.Editor.Tagging.TaggerContext`1, Microsoft.CodeAnalysis.Editor.DocumentSnapshotSpan, System.Nullable`1) + 0x63 <-- Microsoft.CodeAnalysis.EditorFeatures.ni.dll+0x2204c3 79, Microsoft.CodeAnalysis.Editor.Tagging.AbstractAsynchronousTaggerProvider`1+d__26[[System.__Canon, mscorlib]].MoveNext() + 0x21d <-- Microsoft.CodeAnalysis.EditorFeatures.ni.dll+0x22c8fd 80, System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[Microsoft.CodeAnalysis.Editor.Tagging.AbstractAsynchronousTaggerProvider`1+d__26[[System.__Canon, mscorlib]], Microsoft.CodeAnalysis.EditorFeatures]](d__26 ByRef) + 0xa4 <-- 0x7ffa7595a344 81, Microsoft.CodeAnalysis.Editor.Tagging.AbstractAsynchronousTaggerProvider`1[[System.__Canon, mscorlib]].ProduceTagsAsync(Microsoft.CodeAnalysis.Editor.Tagging.TaggerContext`1) + 0x79 <-- Microsoft.CodeAnalysis.EditorFeatures.ni.dll+0x210a29 82, Microsoft.CodeAnalysis.Editor.Tagging.AbstractAsynchronousTaggerProvider`1+TagSource+d__38[[System.__Canon, mscorlib]].MoveNext() + 0x3a8 <-- Microsoft.CodeAnalysis.EditorFeatures.ni.dll+0x22bb18 83, System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) + 0x172 <-- mscorlib.ni.dll+0x58df12 84, System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) + 0x15 <-- mscorlib.ni.dll+0x58dd95 85, System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run() + 0x6f <-- mscorlib.ni.dll+0x5fd00f 86, System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem() + 0x41 <-- mscorlib.ni.dll+0x559bd1 87, System.Threading.ThreadPoolWorkQueue.Dispatch() + 0x156 <-- mscorlib.ni.dll+0x558e46 88, clr.dll!CoUninitializeEE+0x1b93 89, clr.dll!CoUninitializeEE+0x1a98 90, clr.dll!CoUninitializeEE+0x2358 91, clr.dll!CoUninitializeEE+0x737a 92, clr.dll!CoUninitializeEE+0x2f50 93, clr.dll!CoUninitializeEE+0x2ec3 94, clr.dll!CoUninitializeEE+0x2e02 95, clr.dll!CoUninitializeEE+0x2fe7 96, clr.dll!CoUninitializeEE+0x72c7 97, clr.dll!CoUninitializeEE+0x2b17 98, clr.dll!CoUninitializeEE+0x29ef 99, clr.dll!CoUninitializeEE+0x6835 100, kernel32.dll!BaseThreadInitThunk+0x14 101, ntdll.dll!RtlUserThreadStart+0x21 ``` **Evidence: Memory and Managed Heap Snapshots** When I attached another instance of VS to "debug" the problematic instance, and took managed heap snapshots, I noticed that the lion's share of allocated bytes was once again for types in `Microsoft.CodeAnalysis`. Some types had over a million instances! This was not the case prior to DotNet 6 Preview 5 and prior to Preview 5 VS 2019 was not running out of memory at all on the same solution. **Issue with Source Generators** Now, according to every stack trace that I took of VS's threads when it was misbehaving, it always involved `Microsoft.CodeAnalysis.SourceGeneratedDocumentState` and `System.Text.Json.SourceGeneration` types. Also note that my solution _does NOT use_ any source generators. And VS's option `Text Editor > VB/C# > Advanced > Enable all features in opened files from source generators (experimental)` is _tuned OFF_. I presume it might have something to do with Source Generator support being automatically included for `System.Text.Json` starting with Preview 5 (a was noted in your blog post), and so obviously it is applicable to me as I am now on Preview 6. **Expected Behavior**: VS 2019 does not run out of memory. VS 2019 and VS 2022 do not slow down and become sluggish after typing a few characters / words. **Actual Behavior**: Both VS 2019 and 2022 are slowed down, with VS 2019 being slowed down to the point of being completely unusable (due to memory pressure and GC), while VS 2022 is usable but typing experience deteriorates very quickly and becomes often literally one or a few characters per second (i.e. >500ms pause after each character on average). It does not seem to correlate with what file I edit (large or small), what text I edit (comment, type name, variable name, code), and which project the file comes from (one on which other projects in the solution depend, or the one on which no other projects depend).
Author: fitdev
Assignees: -
Labels: `area-System.Text.Json`, `untriaged`
Milestone: -
layomia commented 3 years ago

@fitdev thanks for the feedback. We should minimize the amount of work done when the generator is present but there are no indicated serializable types, and also to make the execution of the generator as efficient as possible when there are types to generate code for. As a starting point - we are currently doing a lot of expensive type resolution every time the generator runs. We should defer this work until we are sure that there are types indicated for source generation, and also cache these type references for reuse whenever possible. One thought here is to observe the compilation instance, and if it's the same as the last one, we reuse some of the relevant metadata that we've computed previously. I'm currently prototyping this approach and will make a PR soon.

As already mentioned we should also consider whether the v2 source generator APIs can help with some of these IDE perf considerations.

Also note that my solution does NOT use any source generators. And VS's option Text Editor > VB/C# > Advanced > Enable all features in opened files from source generators (experimental) is tuned OFF.

This suggests that we might have a scenario in VS where the source generators are invoked even when users explicitly opt out of using them. @chsienki, @KathleenDollard do we have settings specifying this behavior? I wasn't able to find any using Visual Studio Enterprise 2019 16.10.0 Preview 2.1.


Can you provide a sample project to repro the issues you are facing here (sanitized if necessary)? This can help us further understand the issue here and help validate the fixes. Please include any further information about any configuration for your solution(s) & projects.

sharwell commented 3 years ago

@layomia It's extremely difficult to implement source generator caching in a way that is compatible with the semantics of the v1 (non-incremental) API. If the source generator contains a syntax receiver, this task should be treated as impossible; the source generator will not scale to large projects without migration to the v2 (incremental) API. There are two potential resolutions here:

  1. Migrate to the v2 API
  2. Make the source generator execution conditional on build, which renders it unusable in IDE scenarios
layomia commented 3 years ago

Migrate to the v2 API

Thanks @sharwell. I'll start planning for this. I consider this a .NET 6 effort since we want the source generator to be usable in IDE scenarios. cc @ericstj


Update: before committing to reimplementing the generator with v2 APIs at this stage in .NET 6, I think it's better for me to first quantify how bad the problem is and what type of improvements we could see by just refactoring as I mentioned earlier.

ericstj commented 3 years ago

@maryamariyan as it looks like the logging generator has a similar pattern.

fitdev commented 3 years ago

Please include any further information about any configuration for your solution(s) & projects.

@layomia Thank you for looking into this. Unfortunately I cannot provide even a sanitized solution for a repro, as it would involve several 1000 files. Basically I see this behavior with medium-large solutions. As I said, most of my projects are C#, some VB, using latest NET6 Preview 6 and latest VS 2022.

I would eventually like to utilize JSON source generators of course, so it is a great effort, but not until such serious performance issues are addressed. And in any case there hsould be away to completely turn off the feature - either at the IDE level and/or at the project level via something like <EnableFrameworkSourceGenerators>false</EnableFRameworkSourceGenerators>, or perhaps even allowing one to specify specifically which source generators should be enabled (since you also have a Logging source generator - and that only for NET 6): <SourceGeneratorNamespaces>System.Text.Json;Logging;etc.</SourceGeneratorNamespaces>.

ericstj commented 3 years ago

You can add a target to Directory.Build.Targets in your repo to workaround this:

<Target Name="_RemoveTextJsonAnalyzer" BeforeTargets="CoreCompile">
  <ItemGroup>
    <Analyzer Remove="@(Analyzer)" Condition="'%(FileName)' == 'System.Text.Json.SourceGeneration'" />
  </ItemGroup>
</Target>
ericstj commented 3 years ago

CC @russkie as well for winforms generators with SyntaxReceivers

layomia commented 3 years ago

We discussed a plan offline to mitigate the perf regression here. Here's a summary of the current thinking:

Concrete next steps for .NET 6:

fitdev commented 3 years ago

Identify a way to granularly disable source generators (most applicable to VS 19 users experiencing bad perf due to source generators)

This is just as applicable for VS 22, because there may be by now various third-party libraries shipping their own V1 source generators that would slow VS down. So there should be a way to disable source generators at a project / IDE level by either API version, assembly, or both.

eerhardt commented 3 years ago

Identify multi-targeting strategy for shipping both v1 and v2 implementations for use in various IDE & SDK scenarios

The multi-targeting strategy is only necessary for the NuGet package, correct? For the source generators contained in the ref-pack, we should just always use v2, as this is net6.0, which only works with Roslyn v4.0.

PathogenDavid commented 3 years ago

Identify multi-targeting strategy for shipping both v1 and v2 implementations for use in various IDE & SDK scenarios

For NuGet packages I believe https://github.com/dotnet/roslyn/issues/54108 is intended to provide a canonical way to do this.

sharwell commented 3 years ago

For NuGet packages I believe dotnet/roslyn#54108 is intended to provide a canonical way to do this.

@PathogenDavid This approach will only work with environments that understand the new packaging conventions, which means it probably won't work with Roslyn 3.x / VS 2019.

fitdev commented 3 years ago

Just wanted to say that the issue exists in latest VS 2022 Preview 3.1 and DotNet 6 Preview 7. VS is frequently blocked even when typing a mere xml doc comment - something completely unrelated to source generators, let alone Json Source Generator!

Here's the sample stack trace during the "mini-hang" of one of VS's threads:

0, ntoskrnl.exe!KeWaitForSingleObject+0x30c1
1, ntoskrnl.exe!KeWaitForSingleObject+0x1521
2, ntoskrnl.exe!KeWaitForSingleObject+0xadb
3, ntoskrnl.exe!KeWaitForSingleObject+0x1ff
4, ntoskrnl.exe!ExWaitForRundownProtectionRelease+0x9fa
5, ntoskrnl.exe!KeWaitForSingleObject+0x31cb
6, ntoskrnl.exe!KiCheckForKernelApcDelivery+0x27
7, ntoskrnl.exe!KeLeaveGuardedRegion+0x2c
8, FLTMGR.SYS!FltDecodeParameters+0x17be
9, FLTMGR.SYS!FltDecodeParameters+0x14dc
10, FLTMGR.SYS!FltDecodeParameters+0x5f4
11, FLTMGR.SYS!FltDecodeParameters+0x3ee
12, ntoskrnl.exe!IofCallDriver+0x59
13, ntoskrnl.exe!SePrivilegeCheck+0x994
14, ntoskrnl.exe!NtWaitForSingleObject+0x200
15, ntoskrnl.exe!ObfDereferenceObjectWithTag+0xc6
16, ntoskrnl.exe!SeLockSubjectContext+0x2b9
17, ntoskrnl.exe!NtClose+0xcd
18, ntoskrnl.exe!setjmpex+0x6f03
19, ntdll.dll!NtClose+0x14
20, KernelBase.dll!CloseHandle+0x62
21, clr.dll!StrongNameTokenFromPublicKey+0xdd77
22, clr.dll!StrongNameTokenFromPublicKey+0xdad0
23, clr.dll!StrongNameTokenFromPublicKey+0xd90f
24, clr.dll!LogHelp_NoGuiOnAssert+0x6fe38
25, clr.dll!CorExeMain+0x3e0ad
26, clr.dll!NGenCreateNGenWorker+0x2685
27, clr.dll!TranslateSecurityAttributes+0x1c1435
28, System.Reflection.AssemblyName.GetAssemblyName(System.String) + 0x6a <-- mscorlib.ni.dll+0x5a806a
29, System.Linq.Enumerable.ToDictionary[[System.__Canon, mscorlib],[System.__Canon, mscorlib],[System.__Canon, mscorlib]](System.Collections.Generic.IEnumerable`1<System.__Canon>, System.Func`2<System.__Canon,System.__Canon>, System.Func`2<System.__Canon,System.__Canon>, System.Collections.Generic.IEqualityComparer`1<System.__Canon>) + 0xfb <-- System.Core.ni.dll+0x34282b
30, System.Text.Json.Reflection.MetadataLoadContextInternal..ctor(Microsoft.CodeAnalysis.Compilation) + 0x197 <-- 0x7ffddd493117
31, System.Text.Json.SourceGeneration.JsonSourceGenerator+Parser..ctor(Microsoft.CodeAnalysis.GeneratorExecutionContext ByRef) + 0x147 <-- 0x7ffddd491617
32, System.Text.Json.SourceGeneration.JsonSourceGenerator.Execute(Microsoft.CodeAnalysis.GeneratorExecutionContext) + 0x60 <-- 0x7ffddd490cb0
33, Microsoft.CodeAnalysis.SourceGeneratorAdaptor.<Initialize>b__4_5(Microsoft.CodeAnalysis.SourceProductionContext, GeneratorContextBuilder) + 0xf2 <-- 0x7ffddd48fea2
34, Microsoft.CodeAnalysis.UserFunctionExtensions+<>c__DisplayClass3_0`2[[Microsoft.CodeAnalysis.SourceProductionContext, Microsoft.CodeAnalysis],[System.__Canon, mscorlib]].<WrapUserAction>b__0(Microsoft.CodeAnalysis.SourceProductionContext, System.__Canon) + 0x23 <-- 0x7ffddd48fad3
35, Microsoft.CodeAnalysis.SourceOutputNode`1[[System.__Canon, mscorlib]].UpdateStateTable(Builder, Microsoft.CodeAnalysis.NodeStateTable`1<System.ValueTuple`2<System.Collections.Generic.IEnumerable`1<Microsoft.CodeAnalysis.GeneratedSourceText>,System.Collections.Generic.IEnumerable`1<Microsoft.CodeAnalysis.Diagnostic>>>, System.Threading.CancellationToken) + 0x205 <-- 0x7ffddd4516a5
36, Microsoft.CodeAnalysis.DriverStateTable+Builder.GetLatestStateTableForNode[[System.ValueTuple`2[[System.__Canon, mscorlib],[System.__Canon, mscorlib]], mscorlib]](Microsoft.CodeAnalysis.IIncrementalGeneratorNode`1<System.ValueTuple`2<System.__Canon,System.__Canon>>) + 0x110 <-- 0x7ffddd44e220
37, Microsoft.CodeAnalysis.SourceOutputNode`1[[System.__Canon, mscorlib]].AppendOutputs(Microsoft.CodeAnalysis.IncrementalExecutionContext, System.Threading.CancellationToken) + 0x4d <-- 0x7ffddd44cfdd
38, Microsoft.CodeAnalysis.GeneratorDriver.UpdateOutputs(System.Collections.Immutable.ImmutableArray`1<Microsoft.CodeAnalysis.IIncrementalGeneratorOutputNode>, Microsoft.CodeAnalysis.IncrementalGeneratorOutputKind, System.Threading.CancellationToken, Builder) + 0x197 <-- 0x7ffddd44bf57
39, Microsoft.CodeAnalysis.GeneratorDriver.RunGeneratorsCore(Microsoft.CodeAnalysis.Compilation, Microsoft.CodeAnalysis.DiagnosticBag, System.Threading.CancellationToken) + 0xa11 <-- 0x7ffddd446da1
40, Microsoft.CodeAnalysis.SolutionState+CompilationTracker+<FinalizeCompilationAsync>d__30.MoveNext() + 0xce8 <-- Microsoft.CodeAnalysis.Workspaces.ni.dll+0x8fe958
41, System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[Microsoft.CodeAnalysis.SolutionState+CompilationTracker+CompilationInfo, Microsoft.CodeAnalysis.Workspaces]].Start[[Microsoft.CodeAnalysis.SolutionState+CompilationTracker+<FinalizeCompilationAsync>d__30, Microsoft.CodeAnalysis.Workspaces]](<FinalizeCompilationAsync>d__30 ByRef) + 0x87 <-- 0x7ffddbbef3c7
42, Microsoft.CodeAnalysis.SolutionState+CompilationTracker.FinalizeCompilationAsync(Microsoft.CodeAnalysis.SolutionState, Microsoft.CodeAnalysis.Compilation, System.Nullable`1<Microsoft.CodeAnalysis.TextDocumentStates`1<Microsoft.CodeAnalysis.SourceGeneratedDocumentState>>, Microsoft.CodeAnalysis.TextDocumentStates`1<Microsoft.CodeAnalysis.SourceGeneratedDocumentState>, Microsoft.CodeAnalysis.Compilation, Microsoft.CodeAnalysis.GeneratorDriver, System.Threading.CancellationToken) + 0xbd <-- Microsoft.CodeAnalysis.Workspaces.ni.dll+0x8fc31d
43, Microsoft.CodeAnalysis.SolutionState+CompilationTracker.BuildCompilationInfoAsync(Microsoft.CodeAnalysis.SolutionState, System.Threading.CancellationToken) + 0x37e <-- Microsoft.CodeAnalysis.Workspaces.ni.dll+0x1026189
44, Microsoft.CodeAnalysis.SolutionState+CompilationTracker+<GetOrBuildCompilationInfoAsync>d__22.MoveNext() + 0x4a3 <-- Microsoft.CodeAnalysis.Workspaces.ni.dll+0x8fcc53
45, System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[Microsoft.CodeAnalysis.SolutionState+CompilationTracker+CompilationInfo, Microsoft.CodeAnalysis.Workspaces]].Start[[Microsoft.CodeAnalysis.SolutionState+CompilationTracker+<GetOrBuildCompilationInfoAsync>d__22, Microsoft.CodeAnalysis.Workspaces]](<GetOrBuildCompilationInfoAsync>d__22 ByRef) + 0x87 <-- 0x7ffddbbeee87
46, Microsoft.CodeAnalysis.SolutionState+CompilationTracker.GetOrBuildCompilationInfoAsync(Microsoft.CodeAnalysis.SolutionState, Boolean, System.Threading.CancellationToken) + 0x62 <-- Microsoft.CodeAnalysis.Workspaces.ni.dll+0x821f42
47, Microsoft.CodeAnalysis.SolutionState+CompilationTracker+<GetCompilationSlowAsync>d__20.MoveNext() + 0x61 <-- Microsoft.CodeAnalysis.Workspaces.ni.dll+0x8fc631
48, System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.__Canon, mscorlib]].Start[[Microsoft.CodeAnalysis.SolutionState+CompilationTracker+<GetCompilationSlowAsync>d__20, Microsoft.CodeAnalysis.Workspaces]](<GetCompilationSlowAsync>d__20 ByRef) + 0x81 <-- 0x7ffddbbeecf1
49, Microsoft.CodeAnalysis.SolutionState+CompilationTracker.GetCompilationSlowAsync(Microsoft.CodeAnalysis.SolutionState, System.Threading.CancellationToken) + 0x5e <-- Microsoft.CodeAnalysis.Workspaces.ni.dll+0x821ebe
50, Microsoft.CodeAnalysis.SolutionState+CompilationTracker+<GetMetadataReferenceAsync>d__31.MoveNext() + 0x120 <-- Microsoft.CodeAnalysis.Workspaces.ni.dll+0x903c00
51, System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.__Canon, mscorlib]].Start[[Microsoft.CodeAnalysis.SolutionState+CompilationTracker+<GetMetadataReferenceAsync>d__31, Microsoft.CodeAnalysis.Workspaces]](<GetMetadataReferenceAsync>d__31 ByRef) + 0x81 <-- 0x7ffddd431c11
52, Microsoft.CodeAnalysis.SolutionState+CompilationTracker.GetMetadataReferenceAsync(Microsoft.CodeAnalysis.SolutionState, Microsoft.CodeAnalysis.ProjectState, Microsoft.CodeAnalysis.ProjectReference, System.Threading.CancellationToken) + 0x73 <-- Microsoft.CodeAnalysis.Workspaces.ni.dll+0x822483
53, Microsoft.CodeAnalysis.SolutionState.GetMetadataReferenceAsync(Microsoft.CodeAnalysis.ProjectReference, Microsoft.CodeAnalysis.ProjectState, System.Threading.CancellationToken) + 0x4f <-- Microsoft.CodeAnalysis.Workspaces.ni.dll+0x7df79f
54, Microsoft.CodeAnalysis.SolutionState+CompilationTracker+<FinalizeCompilationAsync>d__30.MoveNext() + 0x53e <-- Microsoft.CodeAnalysis.Workspaces.ni.dll+0x8fe1ae
55, System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[Microsoft.CodeAnalysis.SolutionState+CompilationTracker+CompilationInfo, Microsoft.CodeAnalysis.Workspaces]].Start[[Microsoft.CodeAnalysis.SolutionState+CompilationTracker+<FinalizeCompilationAsync>d__30, Microsoft.CodeAnalysis.Workspaces]](<FinalizeCompilationAsync>d__30 ByRef) + 0x87 <-- 0x7ffddbbef3c7
56, Microsoft.CodeAnalysis.SolutionState+CompilationTracker.FinalizeCompilationAsync(Microsoft.CodeAnalysis.SolutionState, Microsoft.CodeAnalysis.Compilation, System.Nullable`1<Microsoft.CodeAnalysis.TextDocumentStates`1<Microsoft.CodeAnalysis.SourceGeneratedDocumentState>>, Microsoft.CodeAnalysis.TextDocumentStates`1<Microsoft.CodeAnalysis.SourceGeneratedDocumentState>, Microsoft.CodeAnalysis.Compilation, Microsoft.CodeAnalysis.GeneratorDriver, System.Threading.CancellationToken) + 0xbd <-- Microsoft.CodeAnalysis.Workspaces.ni.dll+0x8fc31d
57, Microsoft.CodeAnalysis.SolutionState+CompilationTracker.BuildCompilationInfoAsync(Microsoft.CodeAnalysis.SolutionState, System.Threading.CancellationToken) + 0x37e <-- Microsoft.CodeAnalysis.Workspaces.ni.dll+0x1026189
58, Microsoft.CodeAnalysis.SolutionState+CompilationTracker+<GetOrBuildCompilationInfoAsync>d__22.MoveNext() + 0x4a3 <-- Microsoft.CodeAnalysis.Workspaces.ni.dll+0x8fcc53
59, System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[Microsoft.CodeAnalysis.SolutionState+CompilationTracker+CompilationInfo, Microsoft.CodeAnalysis.Workspaces]].Start[[Microsoft.CodeAnalysis.SolutionState+CompilationTracker+<GetOrBuildCompilationInfoAsync>d__22, Microsoft.CodeAnalysis.Workspaces]](<GetOrBuildCompilationInfoAsync>d__22 ByRef) + 0x87 <-- 0x7ffddbbeee87
60, Microsoft.CodeAnalysis.SolutionState+CompilationTracker.GetOrBuildCompilationInfoAsync(Microsoft.CodeAnalysis.SolutionState, Boolean, System.Threading.CancellationToken) + 0x62 <-- Microsoft.CodeAnalysis.Workspaces.ni.dll+0x821f42
61, Microsoft.CodeAnalysis.SolutionState+CompilationTracker+<GetCompilationSlowAsync>d__20.MoveNext() + 0x61 <-- Microsoft.CodeAnalysis.Workspaces.ni.dll+0x8fc631
62, System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.__Canon, mscorlib]].Start[[Microsoft.CodeAnalysis.SolutionState+CompilationTracker+<GetCompilationSlowAsync>d__20, Microsoft.CodeAnalysis.Workspaces]](<GetCompilationSlowAsync>d__20 ByRef) + 0x81 <-- 0x7ffddbbeecf1
63, Microsoft.CodeAnalysis.SolutionState+CompilationTracker.GetCompilationSlowAsync(Microsoft.CodeAnalysis.SolutionState, System.Threading.CancellationToken) + 0x5e <-- Microsoft.CodeAnalysis.Workspaces.ni.dll+0x821ebe
64, Microsoft.CodeAnalysis.SolutionState+CompilationTracker+<GetMetadataReferenceAsync>d__31.MoveNext() + 0x120 <-- Microsoft.CodeAnalysis.Workspaces.ni.dll+0x903c00
65, System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.__Canon, mscorlib]].Start[[Microsoft.CodeAnalysis.SolutionState+CompilationTracker+<GetMetadataReferenceAsync>d__31, Microsoft.CodeAnalysis.Workspaces]](<GetMetadataReferenceAsync>d__31 ByRef) + 0x81 <-- 0x7ffddd431c11
66, Microsoft.CodeAnalysis.SolutionState+CompilationTracker.GetMetadataReferenceAsync(Microsoft.CodeAnalysis.SolutionState, Microsoft.CodeAnalysis.ProjectState, Microsoft.CodeAnalysis.ProjectReference, System.Threading.CancellationToken) + 0x73 <-- Microsoft.CodeAnalysis.Workspaces.ni.dll+0x822483
67, Microsoft.CodeAnalysis.SolutionState.GetMetadataReferenceAsync(Microsoft.CodeAnalysis.ProjectReference, Microsoft.CodeAnalysis.ProjectState, System.Threading.CancellationToken) + 0x4f <-- Microsoft.CodeAnalysis.Workspaces.ni.dll+0x7df79f
68, Microsoft.CodeAnalysis.SolutionState+CompilationTracker+<FinalizeCompilationAsync>d__30.MoveNext() + 0x53e <-- Microsoft.CodeAnalysis.Workspaces.ni.dll+0x8fe1ae
69, System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) + 0x172 <-- mscorlib.ni.dll+0x58df12
70, System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) + 0x15 <-- mscorlib.ni.dll+0x58dd95
71, System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run() + 0x6f <-- mscorlib.ni.dll+0x5fd00f
72, System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action, Boolean, System.Threading.Tasks.Task ByRef) + 0x63 <-- mscorlib.ni.dll+0x602523
73, System.Threading.Tasks.Task.FinishContinuations() + 0x400 <-- mscorlib.ni.dll+0x566f40
74, System.Threading.Tasks.Task`1[[System.__Canon, mscorlib]].TrySetResult(System.__Canon) + 0x68 <-- mscorlib.ni.dll+0x566a88
75, System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.__Canon, mscorlib]].SetResult(System.__Canon) + 0xa3 <-- mscorlib.ni.dll+0x5fc333
76, Microsoft.CodeAnalysis.SolutionState+CompilationTracker+<GetMetadataReferenceAsync>d__31.MoveNext() + 0x374 <-- Microsoft.CodeAnalysis.Workspaces.ni.dll+0x903e54
77, System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) + 0x172 <-- mscorlib.ni.dll+0x58df12
78, System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) + 0x15 <-- mscorlib.ni.dll+0x58dd95
79, System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run() + 0x6f <-- mscorlib.ni.dll+0x5fd00f
80, System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action, Boolean, System.Threading.Tasks.Task ByRef) + 0x63 <-- mscorlib.ni.dll+0x602523
81, System.Threading.Tasks.Task.FinishContinuations() + 0x400 <-- mscorlib.ni.dll+0x566f40
82, System.Threading.Tasks.Task`1[[System.__Canon, mscorlib]].TrySetResult(System.__Canon) + 0x68 <-- mscorlib.ni.dll+0x566a88
83, System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.__Canon, mscorlib]].SetResult(System.__Canon) + 0xa3 <-- mscorlib.ni.dll+0x5fc333
84, Microsoft.CodeAnalysis.SolutionState+CompilationTracker+<GetCompilationSlowAsync>d__20.MoveNext() + 0x17b <-- Microsoft.CodeAnalysis.Workspaces.ni.dll+0x8fc74b
85, System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) + 0x172 <-- mscorlib.ni.dll+0x58df12
86, System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) + 0x15 <-- mscorlib.ni.dll+0x58dd95
87, System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run() + 0x6f <-- mscorlib.ni.dll+0x5fd00f
88, System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action, Boolean, System.Threading.Tasks.Task ByRef) + 0x63 <-- mscorlib.ni.dll+0x602523
89, System.Threading.Tasks.Task.FinishContinuations() + 0x400 <-- mscorlib.ni.dll+0x566f40
90, System.Threading.Tasks.Task`1[[Microsoft.CodeAnalysis.SolutionState+CompilationTracker+CompilationInfo, Microsoft.CodeAnalysis.Workspaces]].TrySetResult(CompilationInfo) + 0x7d <-- 0x7ffddbc503dd
91, System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[Microsoft.CodeAnalysis.SolutionState+CompilationTracker+CompilationInfo, Microsoft.CodeAnalysis.Workspaces]].SetResult(CompilationInfo) + 0xef <-- 0x7ffddbbfccff
92, Microsoft.CodeAnalysis.SolutionState+CompilationTracker+<GetOrBuildCompilationInfoAsync>d__22.MoveNext() + 0x7b2 <-- Microsoft.CodeAnalysis.Workspaces.ni.dll+0x8fcf62
93, System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) + 0x172 <-- mscorlib.ni.dll+0x58df12
94, System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) + 0x15 <-- mscorlib.ni.dll+0x58dd95
95, System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run() + 0x6f <-- mscorlib.ni.dll+0x5fd00f
96, System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action, Boolean, System.Threading.Tasks.Task ByRef) + 0x63 <-- mscorlib.ni.dll+0x602523
97, System.Threading.Tasks.Task.FinishContinuations() + 0x400 <-- mscorlib.ni.dll+0x566f40
98, System.Threading.Tasks.Task`1[[Microsoft.CodeAnalysis.SolutionState+CompilationTracker+CompilationInfo, Microsoft.CodeAnalysis.Workspaces]].TrySetResult(CompilationInfo) + 0x7d <-- 0x7ffddbc503dd
99, System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[Microsoft.CodeAnalysis.SolutionState+CompilationTracker+CompilationInfo, Microsoft.CodeAnalysis.Workspaces]].SetResult(CompilationInfo) + 0xef <-- 0x7ffddbbfccff
100, Microsoft.CodeAnalysis.SolutionState+CompilationTracker+<FinalizeCompilationAsync>d__30.MoveNext() + 0x162d <-- Microsoft.CodeAnalysis.Workspaces.ni.dll+0x8ff29d
101, System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) + 0x172 <-- mscorlib.ni.dll+0x58df12
102, System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) + 0x15 <-- mscorlib.ni.dll+0x58dd95
103, System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run() + 0x6f <-- mscorlib.ni.dll+0x5fd00f
104, System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action, Boolean, System.Threading.Tasks.Task ByRef) + 0x63 <-- mscorlib.ni.dll+0x602523
105, System.Threading.Tasks.Task.FinishContinuations() + 0x400 <-- mscorlib.ni.dll+0x566f40
106, System.Threading.Tasks.Task`1[[System.__Canon, mscorlib]].TrySetResult(System.__Canon) + 0x68 <-- mscorlib.ni.dll+0x566a88
107, System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.__Canon, mscorlib]].SetResult(System.__Canon) + 0xa3 <-- mscorlib.ni.dll+0x5fc333
108, Microsoft.CodeAnalysis.SolutionState+CompilationTracker+<GetMetadataReferenceAsync>d__31.MoveNext() + 0x374 <-- Microsoft.CodeAnalysis.Workspaces.ni.dll+0x903e54
109, System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) + 0x172 <-- mscorlib.ni.dll+0x58df12
110, System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) + 0x15 <-- mscorlib.ni.dll+0x58dd95
111, System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run() + 0x6f <-- mscorlib.ni.dll+0x5fd00f
112, System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action, Boolean, System.Threading.Tasks.Task ByRef) + 0x63 <-- mscorlib.ni.dll+0x602523
113, System.Threading.Tasks.Task.FinishContinuations() + 0x400 <-- mscorlib.ni.dll+0x566f40
114, System.Threading.Tasks.Task`1[[System.__Canon, mscorlib]].TrySetResult(System.__Canon) + 0x68 <-- mscorlib.ni.dll+0x566a88
115, System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.__Canon, mscorlib]].SetResult(System.__Canon) + 0xa3 <-- mscorlib.ni.dll+0x5fc333
116, Microsoft.CodeAnalysis.SolutionState+CompilationTracker+<GetCompilationSlowAsync>d__20.MoveNext() + 0x17b <-- Microsoft.CodeAnalysis.Workspaces.ni.dll+0x8fc74b
117, System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) + 0x172 <-- mscorlib.ni.dll+0x58df12
118, System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) + 0x15 <-- mscorlib.ni.dll+0x58dd95
119, System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run() + 0x6f <-- mscorlib.ni.dll+0x5fd00f
120, System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action, Boolean, System.Threading.Tasks.Task ByRef) + 0x63 <-- mscorlib.ni.dll+0x602523
121, System.Threading.Tasks.Task.FinishContinuations() + 0x400 <-- mscorlib.ni.dll+0x566f40
122, System.Threading.Tasks.Task`1[[Microsoft.CodeAnalysis.SolutionState+CompilationTracker+CompilationInfo, Microsoft.CodeAnalysis.Workspaces]].TrySetResult(CompilationInfo) + 0x7d <-- 0x7ffddbc503dd
123, System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[Microsoft.CodeAnalysis.SolutionState+CompilationTracker+CompilationInfo, Microsoft.CodeAnalysis.Workspaces]].SetResult(CompilationInfo) + 0xef <-- 0x7ffddbbfccff
124, Microsoft.CodeAnalysis.SolutionState+CompilationTracker+<GetOrBuildCompilationInfoAsync>d__22.MoveNext() + 0x7b2 <-- Microsoft.CodeAnalysis.Workspaces.ni.dll+0x8fcf62
125, System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) + 0x172 <-- mscorlib.ni.dll+0x58df12
126, System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) + 0x15 <-- mscorlib.ni.dll+0x58dd95
127, System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run() + 0x6f <-- mscorlib.ni.dll+0x5fd00f
128, System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action, Boolean, System.Threading.Tasks.Task ByRef) + 0x63 <-- mscorlib.ni.dll+0x602523
129, System.Threading.Tasks.Task.FinishContinuations() + 0x400 <-- mscorlib.ni.dll+0x566f40
130, System.Threading.Tasks.Task`1[[Roslyn.Utilities.SemaphoreSlimExtensions+SemaphoreDisposer, Microsoft.CodeAnalysis.Workspaces]].TrySetResult(SemaphoreDisposer) + 0x72 <-- 0x7ffddbbd6922
131, System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[Roslyn.Utilities.SemaphoreSlimExtensions+SemaphoreDisposer, Microsoft.CodeAnalysis.Workspaces]].SetResult(SemaphoreDisposer) + 0xa3 <-- 0x7ffddbbd6843
132, Roslyn.Utilities.SemaphoreSlimExtensions+<DisposableWaitAsync>d__1.MoveNext() + 0x177 <-- Microsoft.CodeAnalysis.Workspaces.ni.dll+0x80e237
133, System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) + 0x172 <-- mscorlib.ni.dll+0x58df12
134, System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) + 0x15 <-- mscorlib.ni.dll+0x58dd95
135, System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run() + 0x6f <-- mscorlib.ni.dll+0x5fd00f
136, System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action, Boolean, System.Threading.Tasks.Task ByRef) + 0x63 <-- mscorlib.ni.dll+0x602523
137, System.Threading.Tasks.Task.FinishContinuations() + 0x400 <-- mscorlib.ni.dll+0x566f40
138, System.Threading.Tasks.Task`1[[System.Boolean, mscorlib]].TrySetResult(Boolean) + 0x5e <-- mscorlib.ni.dll+0x5aaf0e
139, System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.Boolean, mscorlib]].SetResult(Boolean) + 0x9f <-- mscorlib.ni.dll+0x5ab01f
140, System.Threading.SemaphoreSlim+<WaitUntilCountOrTimeoutAsync>d__31.MoveNext() + 0x442 <-- mscorlib.ni.dll+0x1010632
141, System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) + 0x172 <-- mscorlib.ni.dll+0x58df12
142, System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) + 0x15 <-- mscorlib.ni.dll+0x58dd95
143, System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run() + 0x6f <-- mscorlib.ni.dll+0x5fd00f
144, System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action, Boolean, System.Threading.Tasks.Task ByRef) + 0x63 <-- mscorlib.ni.dll+0x602523
145, System.Threading.Tasks.Task.FinishContinuations() + 0x400 <-- mscorlib.ni.dll+0x566f40
146, System.Threading.Tasks.Task`1[[System.__Canon, mscorlib]].TrySetResult(System.__Canon) + 0x68 <-- mscorlib.ni.dll+0x566a88
147, System.Threading.Tasks.TaskFactory+CompleteOnInvokePromise.Invoke(System.Threading.Tasks.Task) + 0xab <-- mscorlib.ni.dll+0x1014c1b
148, System.Threading.Tasks.Task.FinishContinuations() + 0x447 <-- mscorlib.ni.dll+0x566f87
149, System.Threading.Tasks.Task`1[[System.Boolean, mscorlib]].TrySetResult(Boolean) + 0x5e <-- mscorlib.ni.dll+0x5aaf0e
150, System.Threading.SemaphoreSlim+TaskNode.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem() + 0x10 <-- mscorlib.ni.dll+0x100f0a0
151, System.Threading.ThreadPoolWorkQueue.Dispatch() + 0x156 <-- mscorlib.ni.dll+0x558e46
152, clr.dll!CoUninitializeEE+0x1b93
153, clr.dll!CoUninitializeEE+0x1a98
154, clr.dll!CoUninitializeEE+0x2358
155, clr.dll!CoUninitializeEE+0x737a
156, clr.dll!CoUninitializeEE+0x2f50
157, clr.dll!CoUninitializeEE+0x2ec3
158, clr.dll!CoUninitializeEE+0x2e02
159, clr.dll!CoUninitializeEE+0x2fe7
160, clr.dll!CoUninitializeEE+0x72c7
161, clr.dll!CoUninitializeEE+0x2b17
162, clr.dll!CoUninitializeEE+0x29ef
163, clr.dll!CoUninitializeEE+0x6835
164, kernel32.dll!BaseThreadInitThunk+0x14
165, ntdll.dll!RtlUserThreadStart+0x21
sharwell commented 3 years ago

... something completely unrelated to source generators ...

Source generators using the V1 API (as JsonSourceGenerators does) do not distinguish one location in a source file from any other. All locations, including within comments, are equivalent and treated as relevant for them.

fitdev commented 3 years ago

Oh I see. Thank you for pointing this out. Well, I really hope for RTM you move all source generators to V2 and provide clear mechanism to disable all source generators (that may be coming from 3rd party nugets). Because in a solution with ~60 projects and a few thousand files this leads to very serious slowdowns, which is made even worse by the fact that this CPU time is basically wasted since the actual coding does not have anything to do with source generators, and thus ideally none of them should run in the first place.

mayur-ekbote commented 3 years ago

Facing the same issue after moving to .net 6. I do not use any source generators. CPU usage routinely hits 100% after a few keystrokes. VS CPU Usage

eerhardt commented 3 years ago

With #58271 and #58278, the sluggish performance has been addressed in VS 2022. You should see these changes in 6.0-rc1.