Commit e4b68e6
authored
# Which issue does this PR close?
- Closes apache#9429
I'm doing some performance optimization, and noticed that we have a loop
adding one value to the null mask at a time. Instead, I'd suggest adding
`append_non_nulls` to do this at once.
```
append_non_nulls(n) vs append(true) in a loop (with bitmap allocated)
┌───────────┬───────────────────┬─────────────────────┬─────────┐
│ n │ append(true) loop │ append_non_nulls(n) │ speedup │
├───────────┼───────────────────┼─────────────────────┼─────────┤
│ 100 │ 251 ns │ 73 ns │ ~3x │
├───────────┼───────────────────┼─────────────────────┼─────────┤
│ 1,000 │ 2.0 µs │ 94 ns │ ~21x │
├───────────┼───────────────────┼─────────────────────┼─────────┤
│ 10,000 │ 19.3 µs │ 119 ns │ ~162x │
├───────────┼───────────────────┼─────────────────────┼─────────┤
│ 100,000 │ 191 µs │ 348 ns │ ~549x │
├───────────┼───────────────────┼─────────────────────┼─────────┤
│ 1,000,000 │ 1.90 ms │ 3.5 µs │ ~543x │
└───────────┴───────────────────┴─────────────────────┴─────────┘
```
# Rationale for this change
It adds a new public API in favor of performance improvements.
# What changes are included in this PR?
A new public API
# Are these changes tested?
Yes, with new unit-tests.
# Are there any user-facing changes?
Just a new convient API.
1 parent bee4595 commit e4b68e6
1 file changed
Lines changed: 62 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
213 | 213 | | |
214 | 214 | | |
215 | 215 | | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
216 | 222 | | |
217 | 223 | | |
218 | 224 | | |
| |||
727 | 733 | | |
728 | 734 | | |
729 | 735 | | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
730 | 792 | | |
0 commit comments