andygrove opened a new pull request, #4920:
URL: https://github.com/apache/datafusion-comet/pull/4920
> This PR was created by an LLM as a draft PR. I will mark it as ready for
review after human review.
## Which issue does this PR close?
N/A — autonomous exploratory PR.
## Rationale for this change
Replaced the element-by-element Option/Result iterator-collect in
cast_int_to_int_macro with Arrow's vectorized `unary` kernel for Legacy
narrowing casts (and a pre-sized values Vec reusing the source null buffer for
ANSI), removing per-element null-bitmap reads and builder appends.
## What changes are included in this PR?
Replaced the element-by-element Option/Result iterator-collect in
cast_int_to_int_macro with Arrow's vectorized `unary` kernel for Legacy
narrowing casts (and a pre-sized values Vec reusing the source null buffer for
ANSI), removing per-element null-bitmap reads and builder appends.
## How are these changes tested?
Correctness: unit tests + seeded differential fuzz (bit-identical Arrow
output vs `main`).
Benchmark (criterion):
- cast_i32_to_i64: -0.955% faster (base 668ns -> cand 674ns)
- cast_i32_to_i16: 99.275% faster (base 12843ns -> cand 93ns)
- cast_i32_to_i8: 99.276% faster (base 13017ns -> cand 94ns)
Full criterion output:
```text
cast_int_to_int/cast_i32_to_i8
time: [94.165 ns 94.416 ns 94.755 ns]
change: [−99.278% −99.276% −99.274%] (p = 0.00 <
0.05)
Performance has improved.
Found 10 outliers among 100 measurements (10.00%)
1 (1.00%) low severe
2 (2.00%) low mild
1 (1.00%) high mild
6 (6.00%) high severe
cast_int_to_int/cast_i32_to_i16
time: [93.173 ns 93.318 ns 93.454 ns]
change: [−99.276% −99.275% −99.274%] (p = 0.00 <
0.05)
Performance has improved.
Found 20 outliers among 100 measurements (20.00%)
2 (2.00%) low severe
2 (2.00%) low mild
8 (8.00%) high mild
8 (8.00%) high severe
cast_int_to_int/cast_i32_to_i64
time: [673.75 ns 674.38 ns 675.10 ns]
change: [+0.8080% +0.9549% +1.1198%] (p = 0.00 <
0.05)
Change within noise threshold.
Found 18 outliers among 100 measurements (18.00%)
4 (4.00%) low severe
10 (10.00%) low mild
2 (2.00%) high mild
2 (2.00%) high severe
```
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]