Compact run buffer slice values#10292
Conversation
| "the length + offset of the sliced RunEndBuffer cannot exceed the existing length" | ||
| ); | ||
| Self { | ||
| let logical_offset = self.logical_offset + logical_offset; |
There was a problem hiding this comment.
cc @Rich-T-kid this is what i was thinking on my previous comments on your PR
essentially we can still reduce how many physical values we hold on to, without needing to readjust all of the values (still keeping it zero-copy)
we'd need to extend it to runarray too since need to ensure the values array is similarly compacted (might need a bit of plumbing to make it work) and as noted in the issue callsites may need to be adjusted
lemme know your thoughts
|
will take a look this afternoon! |
| // [B, B, B, B, B, B, {B, B, C, C, C, C}] | ||
| let slice = buffer.slice(6, 6); | ||
| assert_eq!(slice.len(), 6); | ||
| assert_eq!(slice.offset(), 6); |
There was a problem hiding this comment.
i realized my initial version of the PR incorrectly adjusted the offset when that wasnt needed; by removing the first physical value its as if the first run was consumed by the following run since we always list run lengths; that is
[4, 8] -> AAAABBBB
[8] -> {BBBB}BBBB
- where
{BBBB}used to be a separate run but is now folded into the first run; this shouldnt matter as our logical offset points beyond it anyway
|
Going to review this PR this week 👍 |
Which issue does this PR close?
Rationale for this change
What changes are included in this PR?
Are these changes tested?
Are there any user-facing changes?