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
Part of #455. Depends on the benchmark baseline from the Phase 0 sub-issue.
Classic analyzer perf bug: calling GetSymbolInfo/GetTypeInfo/GetDeclaredSymbol before cheap syntactic checks (node kind, Identifier.Text, modifiers). Fix by adding a cheap syntactic prefilter before each semantic-model call. Ordered by impact:
ProhibitedMethodsDiagnosticsAnalyzer.cs:281-287 — GetTypeInfo runs on every member access before any name check. Add a static HashSet<string> of banned member names (Now, UtcNow, Today, Parse, InvariantCulture, …) tested against Name.Identifier.Text first. Biggest single win in the package.
ForceMethodParametersInvocationsDiagnosticsAnalyzer.cs:137 — method-name text prefilter (Serialize, SerializeAsync, Deserialize, DeserializeAsync, Received) before FindInvokedMemberSymbol
ProhibitedMethodInvocationsDiagnosticsAnalyzer.cs:154 — prefilter on {True, False, AddOrUpdate, GetOrAdd, Equals} before FindInvokedMemberSymbol
ProhibitedMethodWithStrictParametersInvocationDiagnosticsAnalyzer.cs:110 — prefilter on {Received, AddJsonFile} before FindInvokedMemberSymbol
ProhibitedClassesInTestAssembliesDiagnosticsAnalyzer.cs:141 — syntactic prefilter for Console receivers
ProhibitedSubstituteForUsageInTestBaseDiagnosticsAnalyzer.cs:187 — check syntactic name text is For before GetSymbolInfo
ArgumentExceptionAnalysisDiagnosticsAnalyzer.cs:73 — check objectCreation.Type identifier text against {ArgumentException, ArgumentNullException, ArgumentOutOfRangeException} before GetSymbolInfo
TestClassFieldsAnalysisDiagnosticsAnalyzer.cs:38 — reorder: cheap readonly/const modifier check BEFORE the semantic IsDerivedFromTestBase walk
TestClassPropertyAnalysisDiagnosticsAnalyzer.cs:42 — reorder: syntactic accessor-mutability check BEFORE IsDerivedFromTestBase
TestClassAnalysisDiagnosticsAnalyzer.cs:59 — syntactic attribute-name prefilter ({Fact, Theory, FactAttribute, TheoryAttribute}) before per-attribute GetTypeInfo, and/or gate the analyzer on IsTestAssembly() at compilation start
Verification: full test suite green, benchmarks from the Phase 0 sub-issue show reduced mean time / allocations for affected analyzers, no change in the set of diagnostics produced.
Part of #455. Depends on the benchmark baseline from the Phase 0 sub-issue.
Classic analyzer perf bug: calling
GetSymbolInfo/GetTypeInfo/GetDeclaredSymbolbefore cheap syntactic checks (node kind,Identifier.Text, modifiers). Fix by adding a cheap syntactic prefilter before each semantic-model call. Ordered by impact:ProhibitedMethodsDiagnosticsAnalyzer.cs:281-287—GetTypeInforuns on every member access before any name check. Add a staticHashSet<string>of banned member names (Now,UtcNow,Today,Parse,InvariantCulture, …) tested againstName.Identifier.Textfirst. Biggest single win in the package.ForceMethodParametersInvocationsDiagnosticsAnalyzer.cs:137— method-name text prefilter (Serialize,SerializeAsync,Deserialize,DeserializeAsync,Received) beforeFindInvokedMemberSymbolProhibitedMethodInvocationsDiagnosticsAnalyzer.cs:154— prefilter on {True,False,AddOrUpdate,GetOrAdd,Equals} beforeFindInvokedMemberSymbolProhibitedMethodWithStrictParametersInvocationDiagnosticsAnalyzer.cs:110— prefilter on {Received,AddJsonFile} beforeFindInvokedMemberSymbolProhibitedClassesInTestAssembliesDiagnosticsAnalyzer.cs:141— syntactic prefilter forConsolereceiversProhibitedSubstituteForUsageInTestBaseDiagnosticsAnalyzer.cs:187— check syntactic name text isForbeforeGetSymbolInfoArgumentExceptionAnalysisDiagnosticsAnalyzer.cs:73— checkobjectCreation.Typeidentifier text against {ArgumentException,ArgumentNullException,ArgumentOutOfRangeException} beforeGetSymbolInfoTestClassFieldsAnalysisDiagnosticsAnalyzer.cs:38— reorder: cheapreadonly/constmodifier check BEFORE the semanticIsDerivedFromTestBasewalkTestClassPropertyAnalysisDiagnosticsAnalyzer.cs:42— reorder: syntactic accessor-mutability check BEFOREIsDerivedFromTestBaseTestClassAnalysisDiagnosticsAnalyzer.cs:59— syntactic attribute-name prefilter ({Fact,Theory,FactAttribute,TheoryAttribute}) before per-attributeGetTypeInfo, and/or gate the analyzer onIsTestAssembly()at compilation startVerification: full test suite green, benchmarks from the Phase 0 sub-issue show reduced mean time / allocations for affected analyzers, no change in the set of diagnostics produced.