You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
perf(sdk): stop cloning turn streams in analyze hot paths (#422)
Aggregate per-session/per-file groups by `&TurnRecord` instead of cloning
the full record. The biggest win is `overhead.rs`, which used to clone
every applicable turn per file (~3x for Claude turns with two CLAUDE.md
candidates plus AGENTS.md cross-checks).
- `overhead`: per-file filter into `Vec<&TurnRecord>`; route through a
new internal `attribute_claude_md_refs` so the public
`attribute_claude_md` is a thin wrapper.
- `hotspots`: `IndexMap<String, Vec<&TurnRecord>>` for the per-session
groups; private `attribute_session` / `index_tool_results` now take
`&[&TurnRecord]`.
- `quality`: per-session groups borrow turns; private
`infer_outcome_refs` / `compute_one_shot_rate_refs` drive the work and
the public functions adapt via a single ref collect.
- `compare`: hoist the model-name clone above the three `entry` calls so
we allocate once per *new* model, not four times per turn.
Closes#325.
Co-authored-by: Claude <noreply@anthropic.com>
0 commit comments