Commit e10d606
ARROW-11362:[Rust][DataFusion] Use iterator APIs in to_array_of_size to improve performance
This function `to_array_of_size` is about 8.3% of total instructions in the db-benchmark (aggregation) queries.
This uses the PR #9293
The case of converting an int32 to an array improved by ~5x according to the microbenchmark:
```
to_array_of_size 100000 time: [55.501 us 55.627 us 55.809 us]
change: [-82.457% -82.384% -82.299%] (p = 0.00 < 0.05)
Performance has improved.
Found 3 outliers among 100 measurements (3.00%)
2 (2.00%) high mild
1 (1.00%) high severe
```
And on TCPH query 1 (SF=1, 16 partitions).
PR:
```
Query 1 iteration 0 took 90.8 ms
Query 1 iteration 1 took 106.6 ms
Query 1 iteration 2 took 101.1 ms
Query 1 iteration 3 took 101.5 ms
Query 1 iteration 4 took 96.9 ms
Query 1 iteration 5 took 100.3 ms
Query 1 iteration 6 took 99.6 ms
Query 1 iteration 7 took 100.4 ms
Query 1 iteration 8 took 104.2 ms
Query 1 iteration 9 took 100.3 ms
Query 1 avg time: 100.18 ms
```
Master:
```
Query 1 iteration 0 took 121.1 ms
Query 1 iteration 1 took 123.4 ms
Query 1 iteration 2 took 121.0 ms
Query 1 iteration 3 took 121.0 ms
Query 1 iteration 4 took 123.0 ms
Query 1 iteration 5 took 121.7 ms
Query 1 iteration 6 took 121.7 ms
Query 1 iteration 7 took 120.2 ms
Query 1 iteration 8 took 119.7 ms
Query 1 iteration 9 took 121.4 ms
Query 1 avg time: 121.43 ms
```
Closes #9305 from Dandandan/to_array_of_size_perf
Lead-authored-by: Heres, Daniel <danielheres@gmail.com>
Co-authored-by: Jorge C. Leitao <jorgecarleitao@gmail.com>
Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
Co-authored-by: Sutou Kouhei <kou@clear-code.com>
Co-authored-by: Neville Dipale <nevilledips@gmail.com>
Co-authored-by: Dmitry Patsura <zaets28rus@gmail.com>
Co-authored-by: Yibo Cai <yibo.cai@arm.com>
Co-authored-by: Daniël Heres <danielheres@gmail.com>
Co-authored-by: Kenta Murata <mrkn@mrkn.jp>
Co-authored-by: Mahmut Bulut <vertexclique@gmail.com>
Co-authored-by: Yordan Pavlov <yordan.pavlov@outlook.com>
Co-authored-by: Max Burke <max@urbanlogiq.com>
Co-authored-by: Ryan Jennings <ryan@ryanj.net>
Co-authored-by: Benjamin Kietzman <bengilgit@gmail.com>
Co-authored-by: Jörn Horstmann <joern.horstmann@signavio.com>
Co-authored-by: Krisztián Szűcs <szucs.krisztian@gmail.com>
Co-authored-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>
Co-authored-by: Johannes Müller <JohannesMueller@fico.com>
Co-authored-by: mqy <meng.qingyou@gmail.com>
Co-authored-by: Maarten A. Breddels <maartenbreddels@gmail.com>
Co-authored-by: Antoine Pitrou <antoine@python.org>
Co-authored-by: Matt Brubeck <mbrubeck@limpet.net>
Co-authored-by: Weston Pace <weston.pace@gmail.com>
Signed-off-by: Jorge C. Leitao <jorgecarleitao@gmail.com>1 parent 71dab27 commit e10d606
3 files changed
+139
-24
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
205 | 205 | | |
206 | 206 | | |
207 | 207 | | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 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 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
230 | 306 | | |
231 | 307 | | |
232 | 308 | | |
| |||
238 | 314 | | |
239 | 315 | | |
240 | 316 | | |
241 | | - | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
242 | 323 | | |
243 | 324 | | |
244 | 325 | | |
| |||
0 commit comments