apache / apache/arrow-rs

Reduce bound checks in `take` kernels

Open
#8,879 7 comments 0 reactions 0 assignees View on GitHub
enhancement performance
Dominant language
Rust
Stars
3.6k
Forks
1.3k
Avg merge
2d 18h
Merged PRs (30d)
169

Description

**Is your feature request related to a problem or challenge? Please describe what you are trying to do.**
Take kernels perform bound checks for the kernels, as indices come from outside, however this is at the cost of some performance (~25% I remember from some earlier tests).

In the case of multiple arrays (batches) we perform the bound checks for each array, which is redundant.

**Describe the solution you'd like**

We can run consider having both bound-checked and non-bound-checked versions of the private kernels, and use them for `take_record_batch` for doing the `take` on `>1` arrays.

**Describe alternatives you've considered**

**Additional context**

Contributor guide

Open the contributing guide

Research direction

Start at take_record_batch and trace the private take kernels it uses for single and multiple arrays. Compare where bound checks occur in each path; done means batches avoid repeating redundant checks while preserving the existing take behavior and performance goal.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
performance
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.