Migrate BtreeRangeIter to BtreeCursorRange#1253
Merged
Merged
Conversation
The previous commit replaced BtreeRangeIter at the tree range API; the multimap value subtree iterators were the last in-tree callers. Switch ValueIterState::Subtree and the empty-iterator fallbacks in MultimapValue / MultimapTable / ReadOnlyMultimapTable over to BtreeCursorRange so the BtreeRangeIter struct and its supporting impls in btree_iters.rs can be removed (RangeIterState remains for AllPageNumbersBtreeIter). A micro-benchmark on a 200-key x 5000-value subtree-backed table (release build) shows the new path is slightly faster on every workload exercised: single_key_iter: 72.7 ms -> 64.3 ms range_iter: 75.6 ms -> 68.0 ms reverse_range: 79.0 ms -> 73.0 ms Assisted-by: Claude <noreply@anthropic.com>
76cc77e to
4ffb4a8
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1253 +/- ##
==========================================
+ Coverage 88.10% 88.33% +0.22%
==========================================
Files 36 36
Lines 15220 15022 -198
==========================================
- Hits 13409 13269 -140
+ Misses 1811 1753 -58
🚀 New features to boost your workflow:
|
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
This PR removes the
BtreeRangeIterimplementation and migrates all usages to theBtreeCursorRangetype, consolidating the range iteration logic into a single implementation.Key Changes
Removed from
btree_iters.rs:BtreeRangeIter<K, V>struct definition and all its implementationsis_leaf()andget_entry()fromRangeIterStateIteratorandDoubleEndedIterator)new,new_inner,close,advance, etc.)Updated imports and usages:
BtreeRangeIterfrom public exports intree_store/mod.rsmultimap_table.rsto useBtreeCursorRangeinstead ofBtreeRangeIterin:ValueIterStateenum variantMultimapValue::new_subtree()andnew_subtree_free_on_drop()method signaturesImplementation Details
The migration consolidates range iteration functionality by replacing the standalone
BtreeRangeIterwithBtreeCursorRange, which provides equivalent bidirectional iteration capabilities. TheRangeIterStateenum remains but with reduced helper methods, as the iteration logic is now centralized inBtreeCursorRange.https://claude.ai/code/session_01FjAnvpv4K1pPnshfkNX7Pn