# Minimal Performance Optimization

## Scope

- [x] Keep `arkts-diff` and `codelinter-diff` concurrent.
- [x] Reuse the existing incremental `scope_plan` and transitive relative-import expansion.
- [x] Reuse immutable SDK discovery results within one Node process, keyed by resolved SDK path.
- [x] Reuse the SDK JSON5 parser lookup within one Node process.
- [x] Preserve one-shot checker execution, raw artifacts, and fail-closed behavior.
- [x] Measure cold, warm, incremental, combined and RSS paths.

## Deliberately Deferred

- [ ] Persistent cross-request diagnostic cache.
- [ ] Warm daemon or shared checker server.
- [ ] Shared cache invalidation protocol.
- [ ] Cache reuse across SDK versions, projects or configuration fingerprints.

These require a measured request-volume benefit and a cache key covering source
closure, module configuration, resources, SDK/tool version and checker options.
Until then, one-shot execution is the simpler correctness boundary.

## Acceptance

The optimization must preserve raw structured evidence, changed-line
classification, impacted-file warnings, shadow policy, and unavailable fail-closed results.
Performance receipts belong in `docs/validation.md` and must include wall time,
RSS, checked-file count and finding count.
