perf: optimize get_field - #23537
Conversation
get_field
| .enumerate() | ||
| .find(|(_, t)| t.unwrap()); | ||
| let matched = (start..end).find(|&i| { | ||
| matches.value(i) && match_nulls.is_none_or(|nulls| nulls.is_valid(i)) |
There was a problem hiding this comment.
the previous logic always unwrapped, meaning it ignored any nulls; i assume this is to do with how map array keys cannot be null. perhaps we can follow on that assumption and ignore null check as before?
There was a problem hiding this comment.
Good call — map keys are non-null by definition, so the comparison result never carries nulls here. Dropped the check to match the previous behavior (which unwrapped unconditionally). Done in c4ed51d.
Map keys are non-null by definition, so the comparison result carries no nulls to check while scanning for a match.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #23537 +/- ##
=======================================
Coverage ? 80.67%
=======================================
Files ? 1086
Lines ? 366795
Branches ? 366795
=======================================
Hits ? 295902
Misses ? 53262
Partials ? 17631 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Thanks for the review @Jefffrey |
Which issue does this PR close?
N/A
Rationale for this change
Optimize existing function.
What changes are included in this PR?
Removed the per-row
BooleanArray::sliceallocation in map key lookup by scanning the key-comparison bitmap in place over each row's offset range.Are these changes tested?
Existing tests.
Benchmark (criterion):
Full criterion output:
Are there any user-facing changes?
No