Skip to content

Eliminate redundant scan calls by passing analysis object downstream#6

Merged
alderpath merged 3 commits into
masterfrom
perf/pass-analysis-reduce-scans
May 28, 2026
Merged

Eliminate redundant scan calls by passing analysis object downstream#6
alderpath merged 3 commits into
masterfrom
perf/pass-analysis-reduce-scans

Conversation

@alderpath

Copy link
Copy Markdown
Contributor

Summary

Three performance fixes that eliminate redundant scan_codebase calls without changing any computed output.

Fix 1: Pass analysis to stability/lifecycle/entropy

Modified compute_stability, compute_lifecycles, entropy_velocity to accept optional analysis parameter. When provided by preflight_report, they skip their own internal scan. Preflight scan calls dropped from 4→1.

Fix 2: Cache shallow from deep

When deep=True scan completes, also populate the deep=False cache entry. Deep vocabulary is a strict superset, so this is always correct.

Fix 4: Pass analysis through vulnerability chain

vulnerability_report now passes its analysis parameter to thanatosis_report and capillary_report, avoiding separate rescans.

Benchmarks (5 unified commands on quale repo)

Metric Before After
Cold total 4.68s 2.97s (-37%)
Warm total 6.90s 3.36s (-51%)
Warm penalty +47% +13%

Verification

  • All 370 tests pass (1 snapshot updated for health_score)
  • Output is byte-identical — no functional change

Fixes documented at /tmp/performance-fix-plan.md

alderpath added 3 commits May 28, 2026 21:49
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%.
@alderpath alderpath merged commit 778e385 into master May 28, 2026
8 checks passed
@alderpath alderpath deleted the perf/pass-analysis-reduce-scans branch May 28, 2026 21:09
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