Commit b429fc1
perf(parquet): vectorise dict-index bounds check in
Replace `idx_chunk.iter().all(|&i| (i as usize) < dict_len)` with a
u32 max-reduction (`fold(0u32, |acc, &i| acc.max(i as u32))`). `.all`
short-circuits and so blocks autovectorisation; on aarch64 the old
form compiled to eight serialised `ldrsw` + `cmp` + `b.ls` pairs per
8-index chunk, followed by eight separate scalar gather loads.
The max-reduction has no early exit, so LLVM now lowers the check to
a single `ldp q1, q0` + `umax.4s` + `umaxv.4s` + one `cmp` + `b.ls`,
then reuses the loaded NEON registers for the gather that follows.
Negative `i32` values cast to `u32` become large, so the bounds
check still rejects them.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>RleDecoder::get_batch_with_dict
1 parent 89b1497 commit b429fc1
1 file changed
Lines changed: 8 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
520 | 520 | | |
521 | 521 | | |
522 | 522 | | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
523 | 530 | | |
524 | | - | |
| 531 | + | |
525 | 532 | | |
526 | 533 | | |
527 | 534 | | |
| |||
0 commit comments