You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
All 26 analyzers in src/FunFair.CodeAnalysis register per-syntax-node callbacks (several on InvocationExpression or SimpleMemberAccessExpression, which fire for every call / member access in every file of every consuming build), so per-node costs multiply enormously across builds. A survey found a consistent set of avoidable per-node costs and duplicated helper-shaped code. This issue tracks a phased optimization + commonization pass, broken into the sub-issues below — each phase lands as its own PR, verified against the full test suite and benchmarks with no change in the diagnostics produced. Micro-optimizations are explicitly in scope — small per-node savings add up over thousands of builds.
Constraints: netstandard2.0, LangVersion latest, Roslyn (Microsoft.CodeAnalysis.CSharp) 5.3.0. Record structs and collection expressions are fine; net6+ BCL string/Span helpers are not available.
Good exemplar patterns already in the codebase to copy: InternalsVisibleToDiagnosticsAnalyzer, ProhibitedSubstituteForUsageInTestBaseDiagnosticsAnalyzer and SuppressMessageDiagnosticsAnalyzer (compilation-start GetTypeByMetadataName bail-out + cached-symbol SymbolEqualityComparer comparisons).
All 26 analyzers in
src/FunFair.CodeAnalysisregister per-syntax-node callbacks (several onInvocationExpressionorSimpleMemberAccessExpression, which fire for every call / member access in every file of every consuming build), so per-node costs multiply enormously across builds. A survey found a consistent set of avoidable per-node costs and duplicated helper-shaped code. This issue tracks a phased optimization + commonization pass, broken into the sub-issues below — each phase lands as its own PR, verified against the full test suite and benchmarks with no change in the diagnostics produced. Micro-optimizations are explicitly in scope — small per-node savings add up over thousands of builds.Constraints:
netstandard2.0,LangVersion latest, Roslyn (Microsoft.CodeAnalysis.CSharp) 5.3.0. Record structs and collection expressions are fine; net6+ BCL string/Span helpers are not available.Good exemplar patterns already in the codebase to copy:
InternalsVisibleToDiagnosticsAnalyzer,ProhibitedSubstituteForUsageInTestBaseDiagnosticsAnalyzerandSuppressMessageDiagnosticsAnalyzer(compilation-startGetTypeByMetadataNamebail-out + cached-symbolSymbolEqualityComparercomparisons).Work breakdown
Verification requirements (every phase)