Skip to content

No allocation-budget tests for symbol/reference extraction hot paths #1667

Description

@Widthdom

Summary

PerformanceTests measures wall-clock time on symbol-extraction hot paths but does not assert on memory pressure: heap allocations, Gen2 promotions, or LOH usage. A contributor can shift SymbolExtractor or ReferenceExtractor to a Gen2-heavy pattern (e.g., new intermediate string allocations per match) and slow indexing on real workloads without tripping any test. CI sees green; users see slower indexing and higher RAM.

Where

  • tests/CodeIndex.Tests/PerformanceTests.cs:57-94 (timing tests, no allocation assertions)

Suggested approach

(1) Add BenchmarkDotNet allocation-tracking benchmarks for the hot paths (symbol extract, reference extract, FTS5 query). (2) For CI, capture per-build allocation counts and fail if a PR regresses by >X% versus baseline. (3) Alternative: use System.GC.GetAllocatedBytesForCurrentThread() in xUnit asserts for a small set of scenarios — lower fidelity but no extra dependency.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions