alamb commented on code in PR #10833:
URL: https://github.com/apache/arrow-rs/pull/10833#discussion_r3857313615
##########
arrow-ipc/src/compression.rs:
##########
@@ -328,8 +328,15 @@ fn compress_zstd(
context: &mut IpcWriteContext,
level: i32,
) -> Result<(), ArrowError> {
- let result = context.zstd_compressor(level).compress(input)?;
- output.extend_from_slice(&result);
+ let start = output.len();
+ output.reserve(zstd::zstd_safe::compress_bound(input.len()));
Review Comment:
Internally compress() also calls `compress_bound` for the allocation size
https://docs.rs/zstd/0.13.3/src/zstd/bulk/compressor.rs.html#132
So I think this is no worse (and better as it avoids a copy)
--
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]