gstvg opened a new pull request, #8966:
URL: https://github.com/apache/arrow-rs/pull/8966
# Which issue does this PR close?
Part of #279, related to #8879
# Rationale for this change
```
take check bounds i32 512
time: [338.84 ns 339.71 ns 340.89 ns]
change: [−55.056% −54.843% −54.650%] (p = 0.00 <
0.05)
Performance has improved.
take check bounds i32 1024
time: [548.47 ns 551.23 ns 554.47 ns]
change: [−63.999% −63.813% −63.608%] (p = 0.00 <
0.05)
Performance has improved.
take check bounds i32 8192
time: [3.4934 µs 3.5004 µs 3.5116 µs]
change: [−68.252% −68.158% −68.050%] (p = 0.00 <
0.05)
Performance has improved.
```
# What changes are included in this PR?
Instead of checking index by index, and error-branching individually on
them, check all indices for the presence of *any* out-of-bounds index, and only
then, in the slow-path, find the exact out-of-bounds index
Note how LLVM vectorizes the happy path into a very tight loop:
<img width="634" height="155" alt="image"
src="https://github.com/user-attachments/assets/64006323-ea7c-4fce-8c74-acc32fc5e7d4"
/>
https://rust.godbolt.org/z/MhY4cP6WG
# Are these changes tested?
Existing tests already cover the changed function
# Are there any user-facing changes?
No
--
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]