confirmed Local evidence
Free AI
A one-pass model-selection loop removed an intermediate array and improved every tested registry size without growing the patch.
Availability: Uses the current local Vitest performance path.
Largest tested registry
29.8% faster
0.016568 → 0.011624 ms/op at 79 models
Sampled source bytes
30.1% lower
source and total agree
Peak process-tree RSS
0.0% lower
not material; no regression
Tested boundary
- Flow
- test/select-model-performance.spec.ts — model selection scales across the supported registry size
- Source
- src/router/select-model.ts:171
- Revision
- 23ed8566bb1b1d8d86ee1f9890aa4ad5bba9cd18
Decision path
- observed Allocation hotspot in selectCandidates84.1% of initial sampled allocation bytes pointed at the source.
- tested Build the ranked list directly10 interleaved samples per side covered three registry sizes.
- confirmed Faster with less codeThe candidate removed seven net lines, added no dependency, and passed the bounded change-cost policy.
Patch cost
1 file · +19 / -26 · 45 gross · net -7 · 0 dependencies
Correctness: 241 tests in 37 files passed, plus typecheck and changed-file lint.
What this does not prove
- This proves one synthetic local model-registry workload up to the repository's current 79-model registry; it does not establish production request latency or customer impact.
- Sampled heap bytes include allocations that may later be collected and are not retained-heap measurements.
- Peak RSS is sampled process-tree evidence and includes the runtime and test runner.
- No production endpoint, provider API, cloud resource, package installation, deployment, paid model, or secret operation was used.