Skip to content

perf: avoid repeated hash scans for candidates on the same line - #86

Merged
svozza merged 1 commit into
mainfrom
perf/scan-line-containers
Sep 30, 2026
Merged

svozza merged 1 commit into
mainfrom
perf/scan-line-containers

Conversation

@svozza

@svozza svozza commented Sep 30, 2026 •

Copy link
Copy Markdown
Owner

Secret scanning searched each full line for hash and UUID containers again for every candidate on that line. Large generated JSON lines made this expensive.

Compute those containers lazily once per line. Keep the existing detectors, suppression rules, candidate order, placeholders and redaction behavior. Add regression tests for repeated candidates, independence between lines and lines without candidates.

Full Grafana preparation fell from 431.67s to 183.42s in the local comparison. One 402,894-character JSON fixture fell from 139.71s to 1.04s and returned the same 94 candidates.

Validation:

  • All six frozen source comparisons produced identical prepared prompts, ordered runtime secrets, policy and redacted source trees. Other cases showed only small timing differences.
  • 2,379 unique deterministic tests passed across the full suite and targeted runs; two fixture-dependent tests skipped. Four sandbox-blocked loopback tests passed when rerun with socket access.
  • Type checking and diff checks passed.

These are preparation measurements, not model accuracy or end-to-end review measurements. The initial Grafana pair overlapped on four CPUs; the other pairs ran sequentially in alternating order.

CI passed on the tested commit: 2,379 deterministic tests, type checking, all 42 review scenarios and all six planning scenarios. The first evaluation attempt had one invalid sample after the provider safety classifier interrupted a response. The unchanged rerun passed; the failed scenario’s prepared inputs were confirmed identical to main.

@svozza
svozza had a problem deploying to ai-pr-review-runtime September 30, 2026 21:59 — with GitHub Actions Failure
@svozza
svozza deployed to ai-pr-review-runtime September 30, 2026 22:07 — with GitHub Actions Active
@svozza
svozza merged commit 8b91cb5 into main Sep 30, 2026
10 of 11 checks passed

This branch was successfully deployed

1 active deployment
ai-pr-review-runtime — d553c563 Deployed Sep 30, 2026 by svozza via evals #191
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant