# Repeated setup benchmark
Credential-free benchmark for issue #379. It compares startup settings work, repeated classic-prompt setup, ten identical provider overrides, and provider tool-body construction. Disk conversation snapshots and their hit benchmark have been removed; the context-cache numbers below are historical only.
## Run
```sh
ISSUE_379_BENCH_REPETITIONS=50 \
cargo test --release --locked --lib profile_issue_379_repeated_setup_paths -- --ignored --nocapture
```
The harness emits seven samples per path with minimum, median, and maximum nanoseconds per operation. Debug builds are useful for correctness checks; use release results for performance decisions. The fixture uses a temporary `MC_HOME`, local no-auth provider configuration, local profiles, and no network.
## Issue #379 implementation run
Run on macOS arm64 in the release profile. Each row used 7 samples and 50 repetitions per sample, except the 4 MiB context-cache rows, which used 25 repetitions.
| Startup schema maintenance + config load | 633.37 µs | 593.20 µs | 6% lower |
| Repeated classic-prompt settings/profile setup | 99.27 µs | 0.67 µs | 99% lower |
| Ten identical provider overrides | 2.35 ms | 8.65 µs | 99% lower |
| 4 MiB context-cache hit | 7.58 ms | 5.27 ms | 30% lower |
| Chat tool definitions rebuild/reshape | 35.64 µs | 15.05 µs | 58% lower |
Startup is filesystem-sensitive and had overlapping variance (baseline 604.32–748.46 µs; reused 586.13–618.60 µs). These values are evidence for the local changes, not a hard budget.
Representative provider-body medians from the same run:
| No tools | 0.42 µs |
| Unchanged static tools | 15.74 µs |
| One disabled tool | 66.04 µs |
| One dynamic tool | 72.58 µs |
Dynamic and filtered tool definitions intentionally keep request-local construction. The unchanged Chat Completions and Anthropic tool shapes use provider-ready immutable caches and take one owned clone at the request-body boundary.