Box RleDecoder index buffer (#1061)#1062
Merged
alamb merged 2 commits intoapache:masterfrom Dec 20, 2021
Merged
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1062 +/- ##
==========================================
- Coverage 82.31% 82.31% -0.01%
==========================================
Files 168 168
Lines 49056 49056
==========================================
- Hits 40379 40378 -1
- Misses 8677 8678 +1
Continue to review full report at Codecov.
|
Dandandan
reviewed
Dec 20, 2021
|
|
||
| // Buffer used when `bit_reader` is not `None`, for batch reading. | ||
| index_buf: [i32; 1024], | ||
| index_buf: Option<Box<[i32; 1024]>>, |
Contributor
There was a problem hiding this comment.
While we are at it, could we extract the 1024 to a const?
alamb
approved these changes
Dec 20, 2021
|
|
||
| let mut values_read = 0; | ||
| while values_read < max_values { | ||
| let index_buf = self.index_buf.get_or_insert_with(|| Box::new([0; 1024])); |
Contributor
|
Merging this in to try and clear the PR backlog -- I implemented @Dandandan 's suggestion in #1070 |
alamb
pushed a commit
that referenced
this pull request
Dec 21, 2021
alamb
added a commit
that referenced
this pull request
Dec 22, 2021
* Box RleDecoder index buffer (#1061) * Format Co-authored-by: Raphael Taylor-Davies <[email protected]>
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.
Which issue does this PR close?
Closes #1061.
Rationale for this change
See ticket
What changes are included in this PR?
Changes the
RleDecoderto box its index buffer, this reduces surprises from a 4KbRleDecoderstruct, and reduces heap allocations ifRleDecoderis itself heap allocated andRleDecoder::get_batch_with_dictis never called (e.g. for decoding levels).Running the parquet benchmarks showed no discernible performance impact of this change, as expected
Are there any user-facing changes?
No