Eliminate redundant scan calls by passing analysis object downstream#6
Merged
Conversation
preflight_report, vulnerability_report, thanatosis_report, and capillary_report now accept an optional analysis parameter. When provided, downstream functions (compute_stability, compute_lifecycles, entropy_velocity) skip their own internal scan_codebase call. Fix 2: deep scan populates the shallow cache entry so a subsequent shallow request avoids a re-scan. preflight_report scan calls: 4→1. Cold total -37%, warm penalty -51%.
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
Three performance fixes that eliminate redundant
scan_codebasecalls without changing any computed output.Fix 1: Pass
analysisto stability/lifecycle/entropyModified
compute_stability,compute_lifecycles,entropy_velocityto accept optionalanalysisparameter. When provided bypreflight_report, they skip their own internal scan. Preflight scan calls dropped from 4→1.Fix 2: Cache shallow from deep
When
deep=Truescan completes, also populate thedeep=Falsecache entry. Deep vocabulary is a strict superset, so this is always correct.Fix 4: Pass
analysisthrough vulnerability chainvulnerability_reportnow passes itsanalysisparameter tothanatosis_reportandcapillary_report, avoiding separate rescans.Benchmarks (5 unified commands on quale repo)
Verification
Fixes documented at
/tmp/performance-fix-plan.md