influence anchor arm runs per reference with an unindexable prefix compare; a third-party reachability_anchor package pays ~20 min on a 10k-file tree whenever the grant moves #340
Labels
No labels
code-review
correctness
dos
performance
security
severity/high
severity/low
severity/medium
tech-debt
Kind/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
h-dv/code-index#340
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This was found while working on #334.
Measurement. On a 10k-file Rails tree (Zammad 7.0.2, 646k refs), the general influence pass (
influence::apply_general) takes about 23 min when it runs unscoped:Why the anchor arm is slow. It compares each qualified ref's qualifier against every file key with a prefix test that cannot use an index. That is 150k qualified refs, even though there are only about 9.6k distinct qualifiers.
Scope. #334's fix (
68bca7b5) removes the first-party trigger. A genuinely third-party package that declaresreachability_anchorstill pays this cost on every pass where the grant fingerprint moves.Proposed fix. Evaluate the anchor arm once per DISTINCT qualifier and join the result back to the refs, the way
path_evidence_match_sqlalready does. The estimate is about 15x faster. Measure it withcost_attributionand the #275 Svelte cost test.Related: step 3 ("COMPETED"). It computes the same correlated competitor subquery twice per ref, once in
SETand once inWHERE EXISTS. #275's cost attribution measured it at 86% of the Svelte package's extra SQLite work. AnUPDATE … FROM (SELECT ref_id, MIN(component) … GROUP BY ref_id)would remove the duplicate.Do not move any cost baseline to absorb either cost; reduce the cost first.
Released in v0.35.0 (https://git.h-dv.de/h-dv/code-index/releases/tag/v0.35.0), via PR #351.
What changed:
Results: identical. A differential test against an independently written oracle of the old pass checks this.
Cost:
The
bridge_armfinding is tracked separately in #349.