perf: add syntactic prefilters before semantic-model calls in all affected analyzers#463
Conversation
Prompt: Perf Phase 1: syntactic prefilters before semantic-model calls in all affected analyzers
Pre-commit Hook Failure — Environmental IssueThe pre-commit hook is blocking the commit of the syntactic prefilter implementation due to a missing system utility in the build container. What the hook ranThe hook detected Status of the actual codeThe syntactic prefilter implementation is complete and correct:
Root causeThe build container is missing the To unblockInstall apt-get install -y procpsOr, if the CI environment has The uncommitted implementation is on the local working tree of branch |
Adds ps/pkill/free, needed by .NET benchmark tooling (BenchmarkDotNet process-priority/affinity handling) used in downstream repos. Confirmed locally with `podman build --format docker` of development-tools plus a direct check that ps/pkill/free are present and functional in the built image. Closes #1061 Prompt: apt-get install -y procps can you do that in the appropriate base container needed for funfair-tech/funfair-server-code-analysis#463
## Summary - Installs `procps` (`ps`, `pkill`, `free`, etc.) in `containers/base/development-tools/Dockerfile`, the base apt-packages layer shared by every downstream image (node/python/full/agent). - Needed by .NET benchmark tooling (BenchmarkDotNet process-priority/affinity handling) used in downstream repos — see funfair-tech/funfair-server-code-analysis#463. Closes #1061 ## Test plan - [x] Local `podman build --format docker -t development-tools:local containers/base/development-tools` completes successfully end-to-end (53/53 steps), including the build-time sanity check. - [x] Verified `ps`, `pkill`, `free` are present and functional in the built image (`ps from procps-ng 4.0.4`).
Summary
Add cheap syntactic prefilters immediately before semantic-model calls (
GetTypeInfo,GetSymbolInfo,FindInvokedMemberSymbol) in ten affected analyzers. Each prefilter usesIdentifier.Texton the syntax node's name token and compares against a staticHashSet<string>/FrozenSet<string>, avoiding expensive Roslyn semantic lookups for nodes that cannot possibly match.Affected analyzers:
ProhibitedMethodsDiagnosticsAnalyzer— prefilter on banned member names beforeGetTypeInfoForceMethodParametersInvocationsDiagnosticsAnalyzer— prefilter on{Serialize, SerializeAsync, Deserialize, DeserializeAsync, Received}ProhibitedMethodInvocationsDiagnosticsAnalyzer— prefilter on{True, False, AddOrUpdate, GetOrAdd, Equals}ProhibitedMethodWithStrictParametersInvocationDiagnosticsAnalyzer— prefilter on{Received, AddJsonFile}ProhibitedClassesInTestAssembliesDiagnosticsAnalyzer— syntactic receiver-name prefilter (Console)ProhibitedSubstituteForUsageInTestBaseDiagnosticsAnalyzer— check name isForbeforeGetSymbolInfoArgumentExceptionAnalysisDiagnosticsAnalyzer— prefilter on{ArgumentException, ArgumentNullException, ArgumentOutOfRangeException}TestClassFieldsAnalysisDiagnosticsAnalyzer— reorder:readonly/constcheck BEFOREIsDerivedFromTestBaseTestClassPropertyAnalysisDiagnosticsAnalyzer— reorder: accessor-mutability check BEFOREIsDerivedFromTestBaseTestDetection.IsTestMethod— attribute-name prefilter{Fact, Theory, FactAttribute, TheoryAttribute}beforeGetTypeInfoTest plan
FunFair.CodeAnalysis.Testspass unchanged (no new or removed diagnostics)FunFair.CodeAnalysis.Benchmark.Testsshow reduced mean time and/or allocations vs baselinedotnet buildsucceeds with no warningsdotnet buildcheckpassesCloses #457
🤖 Generated with Claude Code