Skip to content

Commit 861726d

Browse files
Compiler + Tooling: Span visitor improvements (#11966)
This represents several changes to improve efficiency and reduce allocations in the `ClassifiedSpanVisitor`, `TagHelperSpanVisitor`, and `FormattingVisitor`. - Pool `ClassifiedSpanVisitor` instances to reduce allocations. - Move legacy code to the `Legacy` namespace, isolating it from current implementations. - Avoid creating delegates in `ClassifiedSpanVisitor` and `FormattingVisitor`. - Add `SpanComputer` helper to avoid creating syntax nodes just to visit them in `ClassifiedSpanVisitor` and `FormattingVisitor`. - Use pooled array builder for formatting spans to reduce memory pressure. - Add streamlined (i.e. non-Legacy) versions of `GetTagHelpers` and `GetClassifiedSpans` in tooling. These only produce the data needed to support tooling's GetLanguageKind. - Other small tweaks ---- CI Build: https://dev.azure.com/dnceng/internal/_build/results?buildId=2734526&view=results Test Insertion: https://dev.azure.com/devdiv/DevDiv/_git/VS/pullrequest/645479 Toolset Run: https://dev.azure.com/dnceng/internal/_build/results?buildId=2734527&view=results
2 parents e11f855 + 5059a26 commit 861726d

File tree

12 files changed

+1374
-571
lines changed

12 files changed

+1374
-571
lines changed

src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/ClassifiedSpanVisitor.cs

Lines changed: 0 additions & 397 deletions
This file was deleted.

0 commit comments

Comments
 (0)