Commit 9aa1413
authored
perf: Optimize
## Which issue does this PR close?
- Closes #21990.
## Rationale for this change
Rather than computing NULLs on a per-row basis, use the bulk-NULL string
builders to compute them just by copying the input NULL bitmap. See
recent related PRs (#21990, #21853, etc.) for context.
Benchmarks:
StringArray, ASCII
- str_len=8: 61.16 µs → 50.33 µs (−17.7%)
- str_len=32: 73.36 µs → 68.78 µs (−6.9%)
- str_len=128: 93.82 µs → 94.03 µs (+0.7%)
- str_len=4096: 3.614 ms → 2.422 ms (−33.0%)
StringArray, UTF-8 (0.8)
- str_len=8: 195.97 µs → 169.22 µs (−13.4%)
- str_len=32: 818.77 µs → 848.41 µs (+4.1%)
- str_len=128: 3.387 ms → 3.472 ms (+2.5%)
- str_len=4096: 116.88 ms → 117.57 ms (+0.6%)
StringViewArray, ASCII
- str_len=8: 62.67 µs → 51.00 µs (−19.0%)
- str_len=32: 84.74 µs → 76.05 µs (−9.8%)
- str_len=128: 103.49 µs → 89.50 µs (−13.0%)
- str_len=4096: 2.011 ms → 2.021 ms (+0.5%)
StringViewArray, UTF-8 (0.8)
- str_len=8: 207.43 µs → 183.39 µs (−11.2%)
- str_len=32: 840.96 µs → 850.70 µs (+2.4%)
- str_len=128: 3.408 ms → 3.462 ms (+1.6%)
- str_len=4096: 115.38 ms → 117.01 ms (+1.4%)
## What changes are included in this PR?
* Switch to bulk-NULL string builders
* Add a unit test for `reverse` with array inputs and some NULL values,
to ensure that this case is handled correctly
## Are these changes tested?
Yes.
## Are there any user-facing changes?
No.reverse using bulk-NULL string builders (#21991)1 parent b5c481f commit 9aa1413
1 file changed
Lines changed: 106 additions & 31 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | | - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
| 23 | + | |
26 | 24 | | |
27 | 25 | | |
28 | 26 | | |
| |||
103 | 101 | | |
104 | 102 | | |
105 | 103 | | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
106 | 108 | | |
107 | 109 | | |
108 | | - | |
| 110 | + | |
109 | 111 | | |
110 | 112 | | |
111 | 113 | | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
| 114 | + | |
117 | 115 | | |
118 | 116 | | |
119 | 117 | | |
120 | 118 | | |
121 | 119 | | |
122 | 120 | | |
123 | 121 | | |
124 | | - | |
| 122 | + | |
125 | 123 | | |
126 | | - | |
| 124 | + | |
127 | 125 | | |
128 | 126 | | |
129 | 127 | | |
130 | | - | |
| 128 | + | |
131 | 129 | | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
132 | 133 | | |
133 | 134 | | |
134 | 135 | | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
145 | 140 | | |
146 | | - | |
147 | | - | |
148 | | - | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
149 | 144 | | |
150 | | - | |
151 | | - | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
152 | 151 | | |
153 | 152 | | |
154 | 153 | | |
155 | | - | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
156 | 177 | | |
157 | 178 | | |
158 | 179 | | |
| |||
213 | 234 | | |
214 | 235 | | |
215 | 236 | | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
216 | 291 | | |
0 commit comments