perf(graph): build prepared relationship indexes with FxHash maps - #833
Merged
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
jonathanong
force-pushed
the
execute-plan/79dd0742-pr-3-fxhash-preparedrelationshipindex-construction
branch
from
September 5, 2026 07:06
a289092 to
a547305
Compare
jonathanong
marked this pull request as ready for review
September 5, 2026 07:27
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
jonathanong
force-pushed
the
execute-plan/79dd0742-pr-3-fxhash-preparedrelationshipindex-construction
branch
from
September 5, 2026 07:40
a547305 to
38e9fd6
Compare
This comment has been minimized.
This comment has been minimized.
Use FxHash maps/sets and a single sort/dedup per public-name bucket so index construction does not pay SipHash or BTreeSet insert on local keys.
jonathanong
force-pushed
the
execute-plan/79dd0742-pr-3-fxhash-preparedrelationshipindex-construction
branch
from
September 5, 2026 07:46
38e9fd6 to
fbced94
Compare
This comment has been minimized.
This comment has been minimized.
Reserve by raw edge count for the first pass, then drop spare HashMap buckets so duplicate enqueue sites do not keep construction capacity in the retained PreparedRelationshipIndex.
project_first_seen dedupes public report edges whose paths and job names come from repository source. FxHash is reserved for interned analysis keys; restoring HashSet avoids HashDoS on crafted names.
This comment has been minimized.
This comment has been minimized.
jonathanong
deleted the
execute-plan/79dd0742-pr-3-fxhash-preparedrelationshipindex-construction
branch
September 5, 2026 09:18
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
Build
PreparedRelationshipIndexwithFxHashMap/FxHashSet(local interned keys, same policy asfx.rs) and replace per-nameBTreeSetinserts withVec+ one sort/dedup. Public display order and alias grouping are unchanged.Local Criterion (source of truth)
Machine: macOS aarch64, rustc 1.96.0,
--sample-size 20,NO_MISTAKES_BENCH_SHARD=query. Same machine before/after. CodSpeed is not used as a gate.index_constructionindex_constructionscoped_projectionscoped_projectionunscoped_projectionunscoped_projectionShepherd Journal
IC_kwDOSaSRXM8AAAABStKfzQ/IC_kwDOSaSRXM8AAAABStKhDAand Sourcery budget reviewPRR_kwDOSaSRXM8AAAABMTHn8gare bot-limit notices, not code findings; minimize only.PRRT_kwDOSaSRXM6fhSsD: shrinkpublic_namesafter the unique-node fill so raw-edge-count reservation is not retained. Rejected P2PRRT_kwDOSaSRXM6fhXEp: bucketsort/dedupalready unique the stored alias vectors; per-bucket sets would hash Node on every push on the construction path this PR is speeding up, and the duplicate clones are a temporary spike. Codex quota commentsIC_kwDOSaSRXM8AAAABStOd_g/IC_kwDOSaSRXM8AAAABStQZvAare bot-limit notices; minimize only.PRRT_kwDOSaSRXM6fhZii: restore SipHashHashSetinproject_first_seenbecause projected outputs are public report edges from repo source, not interned analysis keys (fx.rs).IC_kwDOSaSRXM8AAAABStTOVQis a bot-limit notice; minimize only.PRRT_kwDOSaSRXM6fhdHG:grouped_nodes/nodes_by_namekeys are public display strings of interned graph nodes, the same local-path universefx.rsalready hashes with FxHash (PathSet). That is analyzed-repo self-DoS, not network input. SipHash here would undo the measured index-construction win. codecov/project/rust "No coverage information found on head" while native/Rust jobs are still inProgress is upload lag.