You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "Jefffrey (via GitHub)" <gi...@apache.org> on 2025/12/29 03:31:38 UTC
Re: [PR] Minor: avoid clone in RunArray row decoding via buffer stealing [arrow-rs]
Jefffrey commented on code in PR #9052:
URL: https://github.com/apache/arrow-rs/pull/9052#discussion_r2650122076
##########
arrow-row/src/run.rs:
##########
@@ -134,7 +134,11 @@ pub unsafe fn decode<R: RunEndIndexType>(
run_ends.push(R::Native::usize_as(idx));
}
unique_row_indices.push(decoded_values.len());
- decoded_values.push(decoded_data.clone());
+ let capacity = decoded_data.capacity();
+ decoded_values.push(std::mem::replace(
+ &mut decoded_data,
+ Vec::with_capacity(capacity),
+ ));
Review Comment:
What do we save here, if we replace a clone with vec allocation anyway?
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org