-
Notifications
You must be signed in to change notification settings - Fork 786
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support nullable indices in boolean take kernel and some optimizations #2064
Conversation
… value bits separately
let index = ToPrimitive::to_usize(&indices.value(i)).ok_or_else(|| { | ||
ArrowError::ComputeError("Cast to usize failed".to_string()) | ||
})?; | ||
indices |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to lose the special case of no null values, I would have naively thought this would make a non-trivial performance difference for the very common case where there aren't any nulls?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was also a bit surprised, we are probably trading the bounds check for indices.value(i)
, which is avoided by the iterator, vs. the added null check. I can try adding another variant without nulls and benchmark that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I basically wonder if it isn't showing up as a regression as separating out the null mask handling makes up for it. However, perhaps we can make it even faster by adding the special case back 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm planning to look at iteration in general in #1857 and ideally convince the compiler to do the specialization itself.
Benchmark runs are scheduled for baseline = 72dada6 and contender = a6379fe. a6379fe is a master commit associated with this PR. Results will be available as each benchmark for each run completes. |
Which issue does this PR close?
Closes #2057.
Rationale for this change
What changes are included in this PR?
PrimitiveIter
to iterate over indices, which makes it easier to handle nullable indices.Are there any user-facing changes?
no
Benchmark results compared to master
There is a small regression for very small inputs, which will probably be alleviated by #1857. Larger inputs see a big improvement.