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
{{ message }}
Repository navigation
Commit d6f510f
Browse filesBrowse the repository at this point in the historyBrowse files
Load each form's history once per invocation, not three times
Another performance pass, same shape as the LLM client reuse fix:
found genuine duplicated I/O by tracing what happens after one
test/monitor run completes, rather than guessing at a bottleneck.
print_run (the CLI diff/flakiness display), notify::regressions_from_history
(--webhook-url), and issues::events_from_history (--github-issues-repo)
each independently called history::load_runs for the exact same URL -
a full directory scan plus parsing every historical run's full JSON,
base64 screenshots included. With both integrations enabled (which the
README documents as the full CI setup), a single monitor run over N
forms did 3N full history reloads instead of N, and it gets worse the
longer a deployment has been accumulating history - exactly the growth
pattern retention/prune exists to bound, but doesn't eliminate.
Fix: main::load_prior_by_url loads each URL's history exactly once per
invocation (deduplicating repeated URLs too, in case a monitor config
lists one twice) and the three consumers take that pre-loaded map
instead of hitting disk themselves. notify::regressions_from_runs and
issues::events_from_runs are renamed from *_from_history since they no
longer do any I/O or return Result - the caller now owns loading, they
just diff what they're given.
Also noticed the "find the run immediately before this timestamp"
snippet (prior.iter().rev().find(|r| r.timestamp < run.timestamp)) was
copy-pasted identically in all three places already being touched -
collapsed into one history::previous_run helper rather than threading
three copies through the refactor.
Verified with two mutation tests: forced load_prior_by_url's dedup to
build a fresh test (confirmed one entry per distinct URL, not one per
call); flipped previous_run's `<` to `<=` and confirmed the new
previous_run test failed (it would otherwise diff a run against
itself), then restored it.
cargo fmt/clippy -D warnings clean, full suite green (155 tests).
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
0 commit comments