Commit beed4f0
authored
perf: Optimize NULL handling in
## Which issue does this PR close?
- Closes #21481.
## Rationale for this change
`array_slice` does a per-row NULL checking (in four different arrays!).
It would be faster to take the union of the four input NULL buffers via
`NullBuffer::union`.
Benchmarks (Arm64):
```
- List(Int64), array args: 60.98ms -> 58.35ms (-4.3%)
- List(Int64), array args, no stride: 28.19ms -> 25.92ms (-8.0%)
- List(Int64), scalar args, no stride: 57.07ms -> 55.56ms (-2.6%)
- List(Int64), scalar args, stride=-2: 99.44ms -> 96.05ms (-3.4%)
- List(Int64), scalar args, stride=-1: 155.23ms -> 155.30ms (+0.0%)
- List(Int64), scalar args, stride=1: 58.50ms -> 55.91ms (-4.4%)
- List(Int64), scalar args, stride=2: 151.45ms -> 146.83ms (-3.1%)
- ListView(Int64), array args: 56.19ms -> 52.86ms (-5.9%)
- ListView(Int64), array args, no stride: 28.53ms -> 24.35ms (-14.7%)
- ListView(Int64), scalar args, no stride: 58.65ms -> 58.34ms (-0.5%)
- ListView(Int64), scalar args, stride=-2: 93.85ms -> 91.59ms (-2.4%)
- ListView(Int64), scalar args, stride=-1: 149.68ms -> 149.06ms (-0.4%)
- ListView(Int64), scalar args, stride=1: 59.53ms -> 58.90ms (-1.1%)
- ListView(Int64), scalar args, stride=2: 143.07ms -> 139.55ms (-2.5%)
```
## What changes are included in this PR?
## Are these changes tested?
Yes.
## Are there any user-facing changes?
No.array_slice (#21482)1 parent 42d9835 commit beed4f0
1 file changed
+27
-22
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
595 | 595 | | |
596 | 596 | | |
597 | 597 | | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
598 | 615 | | |
599 | 616 | | |
600 | 617 | | |
| |||
615 | 632 | | |
616 | 633 | | |
617 | 634 | | |
618 | | - | |
| 635 | + | |
| 636 | + | |
619 | 637 | | |
620 | 638 | | |
621 | 639 | | |
622 | 640 | | |
623 | 641 | | |
624 | 642 | | |
625 | | - | |
626 | | - | |
627 | | - | |
628 | | - | |
629 | | - | |
630 | | - | |
| 643 | + | |
631 | 644 | | |
632 | 645 | | |
633 | | - | |
634 | 646 | | |
635 | 647 | | |
636 | | - | |
637 | 648 | | |
638 | 649 | | |
639 | 650 | | |
| |||
676 | 687 | | |
677 | 688 | | |
678 | 689 | | |
679 | | - | |
| 690 | + | |
680 | 691 | | |
681 | 692 | | |
682 | 693 | | |
| |||
707 | 718 | | |
708 | 719 | | |
709 | 720 | | |
710 | | - | |
| 721 | + | |
| 722 | + | |
711 | 723 | | |
712 | 724 | | |
713 | | - | |
714 | | - | |
715 | | - | |
716 | | - | |
717 | | - | |
718 | | - | |
719 | | - | |
| 725 | + | |
720 | 726 | | |
721 | 727 | | |
722 | 728 | | |
723 | 729 | | |
724 | | - | |
725 | 730 | | |
726 | 731 | | |
727 | 732 | | |
| |||
777 | 782 | | |
778 | 783 | | |
779 | 784 | | |
780 | | - | |
| 785 | + | |
781 | 786 | | |
782 | 787 | | |
783 | 788 | | |
| |||
0 commit comments