Commit de11d9c
perf(parquet): Vectorize dict-index bounds check in RleDecoder::get_batch_with_dict (up to -7.9%) (#9746)
# Which issue does this PR close?
- Close: #9747
# Rationale for this change
Rewrite the code to generate more SIMD instructions / amortize
loop/branching overhead.
# What changes are included in this PR?
One-file change in `parquet/src/encodings/rle.rs`:
- u32 max-reduction bounds check over `CHUNK = 16` indices
- `#[cold] #[inline(never)] fn oob` for the panic path
- `get_unchecked` gather after the vectorised check
| type | main | this-pr | Δ |
| ---------------- | ---------------- | ---------------- | -----:|
| UInt64Array | 60.6 ± 7.75 µs | 55.8 ± 0.58 µs | −7.9% |
| Int64Array | 58.2 ± 0.77 µs | 55.3 ± 0.34 µs | −5.0% |
| INT32 Decimal128 | 88.5 ± 2.07 µs | 84.3 ± 0.35 µs | −4.7% |
| Int32Array | 49.6 ± 0.47 µs | 47.4 ± 0.50 µs | −4.4% |
| UInt8Array | 53.0 ± 0.42 µs | 50.9 ± 0.60 µs | −4.0% |
| Int16Array | 53.6 ± 0.49 µs | 51.7 ± 1.38 µs | −3.6% |
| UInt16Array | 53.2 ± 0.34 µs | 51.7 ± 0.90 µs | −2.8% |
| UInt32Array | 49.7 ± 4.23 µs | 48.4 ± 1.23 µs | −2.6% |
| INT64 Decimal128 | 96.4 ± 2.10 µs | 94.9 ± 1.47 µs | −1.5% |
| Int8Array | 53.2 ± 0.61 µs | 52.8 ± 5.21 µs | −0.7% |
# Are these changes tested?
Existing tests
# Are there any user-facing changes?
No — no API change; decoded output is identical, panic behaviour on
out-of-bounds indices is preserved.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 9d3a4d9 commit de11d9c
1 file changed
Lines changed: 38 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
484 | 484 | | |
485 | 485 | | |
486 | 486 | | |
487 | | - | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
488 | 497 | | |
489 | 498 | | |
490 | 499 | | |
| |||
514 | 523 | | |
515 | 524 | | |
516 | 525 | | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
517 | 536 | | |
518 | 537 | | |
519 | | - | |
520 | | - | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
521 | 541 | | |
522 | | - | |
523 | | - | |
524 | | - | |
525 | | - | |
526 | | - | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
527 | 550 | | |
528 | 551 | | |
529 | 552 | | |
| |||
532 | 555 | | |
533 | 556 | | |
534 | 557 | | |
535 | | - | |
| 558 | + | |
536 | 559 | | |
537 | | - | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
538 | 566 | | |
539 | 567 | | |
540 | 568 | | |
| |||
0 commit comments