# Performance Optimization is measurement-first and gate-guarded. Every candidate change runs through the manifest-driven evaluation harness (`tests/benchmarks/projects/*.json`), which enforces finding-fingerprint stability, reviewed dispositions, wall-time and RSS regression baselines, and a gold set (`bench/gold/`). The gold set was derived from fold's own reviewed output and is matched by detector kind and file, so it catches drift; it is not an independent precision or recall measure. A ledger of measured wins and closed hypotheses is in [the optimization loop](../research/optimization-loop-2026-07-30.md). ## Single-pass graph building The one structural item on the roadmap is single-pass graph building. A source scan currently parses each translation unit twice: once to build the project call graph, and once to run detectors, because the detector pass consumes the graph (cross-TU candidate expansion and summary priming). The planned change collapses these into one parse per TU that produces graph contributions and runs the intra-TU detectors in the same pass, keeping only light per-TU edge and signature records, then runs the cross-TU-dependent closure after every TU. See [the design](../research/single-pass-graph-design.md). This is chosen over precompiled-header or module caching to preserve portability: it introduces no Clang-version-locked serialized artifacts, no SDK- or toolchain-locked module cache, and no `-std`/`-I`/`-D` flag-matching bug surface, so every machine that consumes a `compile_commands.json` today keeps working. Correctness parity for the deferred closure is policed by the existing finding-fingerprint and gold gates.