Repository navigation
A feature range read decodes each point where it sits in the cached block - #3161
Open
matrixarkai wants to merge 1 commit into
Open
matrixarkai wants to merge 1 commit into
matrixarkai wants to merge 1 commit into
Conversation
matrixarkai
force-pushed
the
perf/a-feature-range-read-decodes-each-point-where-it-sits
branch
from
November 15, 2026 23:46
99c3906 to
d42a4e2
Compare
matrixarkai
force-pushed
the
perf/a-feature-range-read-decodes-each-point-where-it-sits
branch
from
November 16, 2026 02:53
f261e72 to
512d30a
Compare
matrixarkai
marked this pull request as ready for review
November 16, 2026 02:56
…lock FeatureQuery and FeatureQueryFiltered copied each block out of the cache, decoded all of it into a vector of points, and cloned the wanted point out; the filtered read did that for every point in the window and dropped the ones the filters refused. Points are now read from the cached block's bytes, a block is walked once, and a value is copied only into a point the answer keeps. The window is still capped before the filters. The sequence read's guard now compares against a range read that keeps one value per point, since the range read no longer builds a point per point of the block. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
matrixarkai
force-pushed
the
perf/a-feature-range-read-decodes-each-point-where-it-sits
branch
from
November 16, 2026 04:29
512d30a to
cc895a8
Compare
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.
FeatureQueryandFeatureQueryFilteredcopied each block out of the cache, decoded all of it into aVec<FeaturePoint>(a valueVecper point of the block, wanted or not), kept that in a table keyed by the block's address, and cloned the wanted point out of it. The filtered read did all of that for every point in the window and then dropped the points the filters refused. Each point is now read where it sits in the cached block's bytes (a cursor walks an ascending block once; any other shape is read point by point as before), and a value is copied only into a point the answer keeps. This is the same treatmentSequenceQuerygot in #3099.The answers do not change: the window is still capped at
countpoints BEFORE the filters (a cap that cuts through refused points answers fewer thancount), a torn or forged block is refused as before, the first of a repeated instant wins, and an unreadable row is counted once per read. No stored or wire byte changes.Measured (counting allocator, release,
alloc-probe, 40 queries over a series appended in 100-point blocks; before = the replaced reader selected by a temporary switch in a scratch build of the same tree):The unfiltered whole-series read is now one allocation per returned point (the value the answer keeps); the filtered reads allocate for what passes and for nothing else.
The existing sequence guard changes (
a_sequence_query_does_not_allocate_per_row): its control was the range read, which it required to cost at least twice a sequence read. The range read is now cheaper, so that ratio no longer holds; the guard now requires the sequence read to cost less than the range read that keeps a value per point, and its other two assertions are unchanged.Plant: #3170 restores the old arms under the same guards; the guard must fail with the old counts. Guards, pinned by exact name in
rust-ci.yml:the_cursor_answers_what_the_decoder_answers(the walker against the strict decoder over ascending, sparse, backward, repeated and shuffled instants, every truncation of a block, trailing bytes, a forged count, a repeated or descending instant, the JSON shape, an unframed value),a_range_read_answers_what_was_appended(both reads against a model, over one block of many points, one-point blocks, replaced instants, windows, caps, four filters, a trimmed series and a reload), and the probea_feature_range_read_does_not_allocate_per_point_of_the_block, with the unfiltered read's one-per-point slope as its control.Not measured: instructions (the cursor adds a validation walk per block, linear, where the old decode was linear too); wall time. The thresholds of the new probe were set from the measured slopes above, not yet read back from a CI run of this branch. Net about 150 lines of code, 420 of test.
🤖 Generated with Claude Code