Robj/prefetching#681
Open
rtjohnso wants to merge 7 commits into
Open
Conversation
Signed-off-by: Rob Johnson <rob@robjohnson.io>
Signed-off-by: Rob Johnson <rob@robjohnson.io>
Compaction (trunk_branch_merger): thread prefetch_budget from splinterdb_config through trunk_config into build_merge_itor, which divides the budget across branches (max(2, budget/extent_size/N)) and calls btree_iterator_set_prefetch_lookahead on each. Measured ~1.4x faster full-leaf optimize vs the notification-fixes baseline. Backward scan prefetch: add mini_meta_cursor_prev() which walks the doubly-linked meta-page list in reverse, keeping the current page alive during WOULD_BLOCK so prev_meta_addr stays accessible for retry (unlike the forward cursor which releases on miss). Add fill_backward, pump_backward, on_boundary_backward, and start_backward symmetric to the forward equivalents. btree_iterator_prefetch_on_advance now takes a going_forward parameter; on a direction change it restarts the cursor (resetting the ramp) so both directions get the same slow-start treatment. btree_iterator_prev_leaf/async now call prefetch_on_advance rather than killing the cursor. Measured ~40x improvement for backward scans (baseline had zero prefetch -- prev_leaf was calling btree_prefetch_cursor_deinit on every leaf step). Also add --optimize-only mode to scan_benchmark for measuring cold compaction throughput. Validated: unit_test btree 5/5, splinterdb_quick 33/33 (release + ASAN); backward scan returns correct tuple count; no ASAN errors. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Rob Johnson <rob@robjohnson.io>
✅ Deploy Preview for splinterdb canceled.
|
Signed-off-by: Rob Johnson <rob@robjohnson.io>
Signed-off-by: Rob Johnson <rob@robjohnson.io>
Signed-off-by: Rob Johnson <rob@robjohnson.io>
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.
Implement deeper prefetching by using the mini allocator as the source of addresses.