perf: resolve scan/review pipeline performance bottlenecks (P2)#338
Merged
Conversation
Fix 10 performance issues — all 'repeated work in loops' patterns: #41 - Pre-compile regex patterns once per rule instead of per line #5 - Batch DB queries in handle_find_affected_tests (single IN clause) #13 - Batch symbol fetch for Affected command (single query) #14 - Prepare SQL statement once outside test-pattern loop #59 - Early cutoff in secrets scanner when max_findings reached #70 - Break out of all loops when symbol cap hit per file #67 - Cache file reads during sibling search in resolver #3 - Reuse single Tokio runtime for MCP tool calls (static LazyLock) #22 - Static LazyLock regexes in detect_function_entry #24 - Single transaction for prune_deleted instead of per-file Refs #335
- clippy: remove redundant borrow in format! arg (llm.rs:456 &user_prompt) - security: bump anyhow 1.0.102 -> 1.0.103 (RUSTSEC-2026-0190, downcast_mut unsoundness) - security: bump crossbeam-epoch 0.9.18 -> 0.9.20 (RUSTSEC-2026-0204, fmt::Pointer null deref) Refs #335
This was referenced Jul 16, 2026
ajianaz
added a commit
that referenced
this pull request
Jul 16, 2026
…eyword (#341) A merged PR that references issues via "Refs #N" (not "Closes #N") has no closingIssuesReferences — a legitimate non-error outcome. Previously the script could abort with exit 1 under 'set -e' when get_item_id() hit an unexpected GraphQL response shape (e.g. node: null), surfacing as a red 'sync' check on otherwise-green PRs (e.g. PR #338 merge). - Make get_item_id() and the LINKED query python defensive against null/unexpected shapes - Guard the empty-LINKED branch call sites with '|| true' so a missing board item never aborts the job
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.
Summary
Fixes 10 performance bottlenecks across the scan/review pipeline. All are "repeated work in loops" patterns — the fix is always the same: do it once outside the loop.
Fixes
src/engine/rules/matching.rsensure_compiled()src/mcp/tools.rsINquerysrc/main.rssrc/main.rssrc/engine/secrets_scanner.rssrc/engine/context/extraction.rssrc/engine/context/resolver.rsHashMap<PathBuf, String>cachesrc/mcp/tools.rsLazyLock<Runtime>src/index/extract.rsdetect_function_entrycallstatic LazyLock<Regex>per languagesrc/index/mod.rsTesting
cargo test)cargo clippy)cargo fmt)Refs #335