Commit 01d34a8
authored
Add
# Which issue does this PR close?
- Closes apache#9425.
# Rationale for this change
I noticed that this method is available on PrimitiveTypeBuilder, but
missing on the GenericByteBuilder, which make sense since the gain is
less, but after benchmarking, it shows a solid 10%. Mostly because the
more efficient allocation of the null-mask.
```
┌───────────────────┬────────────────┬───────────────────┬─────────┐
│ Benchmark │ append_value_n │ append_value loop │ Speedup │
├───────────────────┼────────────────┼───────────────────┼─────────┤
│ n=100/len=5 │ 371 ns │ 408 ns │ 10% │
├───────────────────┼────────────────┼───────────────────┼─────────┤
│ n=100/len=30 │ 456 ns │ 507 ns │ 10% │
├───────────────────┼────────────────┼───────────────────┼─────────┤
│ n=100/len=1024 │ 1.81 µs │ 1.95 µs │ 8% │
├───────────────────┼────────────────┼───────────────────┼─────────┤
│ n=1000/len=5 │ 2.39 µs │ 2.87 µs │ 17% │
├───────────────────┼────────────────┼───────────────────┼─────────┤
│ n=1000/len=30 │ 3.41 µs │ 3.89 µs │ 12% │
├───────────────────┼────────────────┼───────────────────┼─────────┤
│ n=1000/len=1024 │ 12.3 µs │ 14.4 µs │ 15% │
├───────────────────┼────────────────┼───────────────────┼─────────┤
│ n=10000/len=5 │ 23.8 µs │ 29.3 µs │ 19% │
├───────────────────┼────────────────┼───────────────────┼─────────┤
│ n=10000/len=30 │ 33.7 µs │ 39.0 µs │ 14% │
├───────────────────┼────────────────┼───────────────────┼─────────┤
│ n=10000/len=1024 │ 115.9 µs │ 135.0 µs │ 14% │
├───────────────────┼────────────────┼───────────────────┼─────────┤
│ n=100000/len=5 │ 227.5 µs │ 278.6 µs │ 18% │
├───────────────────┼────────────────┼───────────────────┼─────────┤
│ n=100000/len=30 │ 328.1 µs │ 377.9 µs │ 13% │
├───────────────────┼────────────────┼───────────────────┼─────────┤
│ n=100000/len=1024 │ 1.16 ms │ 1.34 ms │ 14% │
└───────────────────┴────────────────┴───────────────────┴─────────┘
```
I think this is still worthwhile to be added. Let me know what the
community thinks!
# What changes are included in this PR?
A new public API.
# Are these changes tested?
Yes!
# Are there any user-facing changes?
A new public API.append_value_n to GenericByteBuilder (apache#9426)1 parent 73a516e commit 01d34a8
1 file changed
Lines changed: 32 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
113 | 128 | | |
114 | 129 | | |
115 | 130 | | |
| |||
939 | 954 | | |
940 | 955 | | |
941 | 956 | | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
942 | 974 | | |
0 commit comments