Skip to content

Robj/prefetching#681

Open
rtjohnso wants to merge 7 commits into
mainfrom
robj/prefetching
Open

Robj/prefetching#681
rtjohnso wants to merge 7 commits into
mainfrom
robj/prefetching

Conversation

@rtjohnso

Copy link
Copy Markdown
Collaborator

Implement deeper prefetching by using the mini allocator as the source of addresses.

rtjohnso and others added 4 commits June 25, 2026 11:57
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>
@netlify

netlify Bot commented Jun 25, 2026

Copy link
Copy Markdown

Deploy Preview for splinterdb canceled.

Name Link
🔨 Latest commit 3c28095
🔍 Latest deploy log https://app.netlify.com/projects/splinterdb/deploys/6a3e232494c0e90008f8f748

rtjohnso added 3 commits June 25, 2026 23:54
Signed-off-by: Rob Johnson <rob@robjohnson.io>
Signed-off-by: Rob Johnson <rob@robjohnson.io>
Signed-off-by: Rob Johnson <rob@robjohnson.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant