perf: avoid repeated hash scans for candidates on the same line - #86
Merged
Merged
Conversation
svozza
had a problem deploying
to
ai-pr-review-runtime
September 30, 2026 21:59 — with
GitHub Actions
Failure
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
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.