mbutrovich commented on code in PR #12076:
URL: https://github.com/apache/arrow-rs/pull/12076#discussion_r4473886528
##########
arrow-arith/benches/integer_division.rs:
##########
@@ -37,24 +37,40 @@ where
{
let mut rng = StdRng::seed_from_u64(42);
let array = PrimitiveArray::<T>::from_iter_values((0..SIZE).map(|_|
rng.random()));
- // A fifth of the values null, at random positions
- let nulls = NullBuffer::from_iter((0..SIZE).map(|_| rng.random_ratio(4,
5)));
- let with_nulls = PrimitiveArray::<T>::new(array.values().clone(),
Some(nulls));
+ // A fifth, half, and nine tenths of the values null, at random positions.
Visiting only the
+ // valid values does less work as the share of nulls grows
Review Comment:
> benchmark results look strong already, do we need to add these as we all
or should they be split into a separate PR?
They're what the kernel's two paths are tuned against, so I'd keep them
here. Before these cases, the PR divided every slot whatever the nulls. With
nine tenths of the values null that was 0.27x to 0.72x of `main` on [Xeon
8581C](https://github.com/apache/arrow-rs/pull/12076#issuecomment-6639103313),
because `main` divides only the valid values. The null-count thresholds in
`divisor_op!` come from runs of these cases, and anyone who changes the
thresholds later needs them to show it doesn't regress.
--
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]