jhorstmann commented on code in PR #1048:
URL: https://github.com/apache/arrow-rs/pull/1048#discussion_r884299732
##########
arrow/src/compute/kernels/sort.rs:
##########
@@ -151,8 +152,16 @@ fn partition_validity(array: &ArrayRef) -> (Vec<u32>,
Vec<u32>) {
// faster path
0 => ((0..(array.len() as u32)).collect(), vec![]),
_ => {
- let indices = 0..(array.len() as u32);
- indices.partition(|index| array.is_valid(*index as usize))
+ let validity = array.data().null_buffer().unwrap();
Review Comment:
Noticed this as a hotspot while profiling. The `is_valid` function does not
seem to get inlined and contains a branch, and we can also initialize both
vectors with the right capacities.
--
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]