perf(parquet): Defer fixed length byte array buffer alloc and skip zero-batch init#9756
Open
lyang24 wants to merge 1 commit intoapache:mainfrom
Open
perf(parquet): Defer fixed length byte array buffer alloc and skip zero-batch init#9756lyang24 wants to merge 1 commit intoapache:mainfrom
lyang24 wants to merge 1 commit intoapache:mainfrom
Conversation
- FixedLenByteArrayBuffer: preserve the value-count hint in `with_capacity` and defer the buffer allocation to the first `ValueDecoder::read`, when `byte_length` is known. This lets the buffer be sized exactly once (`values_capacity * byte_length`) instead of growing incrementally from `Vec::new()`. - RecordReader::read_one_batch: short-circuit with `Ok(0)` when `batch_size == 0` to avoid the lazy buffer init on an end-of-stream read. Signed-off-by: lyang24 <lanqingy93@gmail.com>
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.
follow ups from #9093
with_capacityand defer the buffer allocation to the firstValueDecoder::read, whenbyte_lengthis known. This lets the buffer be sized exactly once (values_capacity * byte_length) instead of growing incrementally fromVec::new().Ok(0)whenbatch_size == 0to avoid the lazy buffer init on an end-of-stream read.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?