perf: use foldhash for log-replay file dedup set#2698
Open
DrakeLin wants to merge 1 commit into
Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2698 +/- ##
==========================================
- Coverage 88.85% 88.85% -0.01%
==========================================
Files 199 199
Lines 64673 64820 +147
Branches 64673 64820 +147
==========================================
+ Hits 57465 57595 +130
- Misses 5022 5027 +5
- Partials 2186 2198 +12 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Benchmark resultsCommit:
|
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.
What changes are proposed in this pull request?
Swap the std
HashSetused to track seen(path, dv_unique_id)pairs during log replay for aHashSetbacked byfoldhash::fast::RandomState. This is the hottest hash structure on the read path: every Add/Remove across every commit and every action in every checkpoint hits acontainsand (for commit batches) aninsert. SipHash-1-3 (the std default) is ~2x slower than foldhash on small keys for no functional benefit here.The alternate hasher is hidden behind a crate-private
SeenFileKeystype alias.SerializableScanState.seen_file_keyskeeps its existingHashSet<FileActionKey>(std hasher) so the distributed-scan wire format and public API are unchanged; conversion happens once per phase boundary.foldhash::fast::RandomStatereseeds per-process, so HashDoS resistance for path keys read from the Delta log is preserved.How was this change tested?
cargo nextest run -p delta_kernel --all-features(4704 tests pass)cargo clippy --workspace --benches --tests --all-features -- -D warningscargo doc --workspace --all-features --no-deps