rok commented on code in PR #41546:
URL: https://github.com/apache/arrow/pull/41546#discussion_r1590748410
##########
cpp/src/parquet/encoding.cc:
##########
@@ -2740,13 +2740,12 @@ class DeltaLengthByteArrayEncoder : public EncoderImpl,
: EncoderImpl(descr, Encoding::DELTA_LENGTH_BYTE_ARRAY,
pool = ::arrow::default_memory_pool()),
sink_(pool),
- length_encoder_(nullptr, pool),
- encoded_size_{0} {}
+ length_encoder_(nullptr, pool) {}
std::shared_ptr<Buffer> FlushValues() override;
int64_t EstimatedDataEncodedSize() override {
- return encoded_size_ + length_encoder_.EstimatedDataEncodedSize();
+ return sink_.length() + length_encoder_.EstimatedDataEncodedSize();
Review Comment:
This will probably be slightly less precise (because `sink_.resize ` will
resize to multiple of 64 bytes), but that's inline with expectations. I wonder
if this would reduce number of allocations and improve performance?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]