Skip to content

Perf Phase 0: benchmark baseline for hot analyzers #456

Description

@credfeto

Part of #455.

The benchmark project currently covers only SuppressMessageDiagnosticsAnalyzer (FunFair.CodeAnalysis.Benchmark.Tests/Bench/SuppressMessageAnalyzerBenchmark.cs, with allocation-ceiling assertions in SuppressMessageAnalyzerBenchmarkTests.cs). Before optimizing anything, add benchmarks in the same pattern for the analyzers targeted by later phases, so each phase has a measurable before/after.

  • Benchmark for ProhibitedMethodsDiagnosticsAnalyzer (fires on every SimpleMemberAccessExpression — the hottest path in the package)
  • Benchmark covering the invocation-analyzer family (ProhibitedMethodInvocations, ForceMethodParametersInvocations, ProhibitedMethodWithStrictParametersInvocation)
  • Benchmark for the TestClass* trio / TestDetection.IsDerivedFromTestBase paths
  • Record baseline numbers (mean time + allocated bytes) in this issue before Phase 1 starts

Verification: new benchmark classes run cleanly via the existing dotnet test-driven benchmark harness (see SuppressMessageAnalyzerBenchmarkTests.cs for the pattern of running the benchmark and asserting allocation ceilings).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions