Repository navigation
perf(layout): stop retaining segments across V2 scans - #11408
Draft
joseph-isaacs wants to merge 18 commits into
Draft
joseph-isaacs wants to merge 18 commits into
joseph-isaacs wants to merge 18 commits into
Conversation
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
Experiment, stacked on #11377 (which includes #11399). It asks whether the V2 scan's
RetainedSegmentscache can be removed outright instead of made faster. Only the last commit,b312ac3, is new here. The benchmark bot compares against develop, so judge this PR by its results next to #11377's head (83cb452, whose code is the same asfc29d86).RetainedSegmentskeeps up to 64 MiB of recently read segment bytes per file. It exists so chunks of a scan that share a stored segment read it once. On develop, chunks launch spaced apart, so a later chunk often starts after its neighbour's read finished and would read the segment again. #11377 launches a take's chunks together. Their requests for a shared segment then overlap in flight, and the file's segment source merges them, so the retention may no longer earn its memory and its lookup on every request.It is also the only cache of segment bytes across scans by default:
VortexOpenOptionsfalls back toNoOpSegmentCache. Removing it should therefore show up in cached-mode random access, where repeated takes on an open file currently hit it.SegmentCacheremains the explicit way to keep segments across scans.Changes
RetainedSegments,RetainingSegmentSourceandvortex-layout/src/scan/v2/retain.rs. Scans read through the file's segment source directly.chunks_sharing_a_segment_read_it_oncetest, which tested retention.ScanCache::with_retained_bytes(0)now useScanCache::default().Checks run:
cargo clippy -p vortex-layout --all-targets --all-features -- -D warnings(clean),cargo test -p vortex-layout --lib(804 passed).API Changes
Removes the public
ScanCache::with_retained_bytes. Nothing else in the workspace or the bindings calls it.Generated by Claude Code