Commit 237065b
# Which issue does this PR close?
- Part of #9061
- broken out of #9058
# Rationale for this change
The current implementation of `make_array` for StructArray and
GenericByteViewArray clones `ArrayData` which allocates a new Vec. This
is unnecessary given that `make_array` is passed an owned ArrayData
# What changes are included in this PR?
1. Add a new API to ArrayData to break it down into parts (`into_parts`)
2. Use that API to avoid cloning while constructing StructArray and
GenericByteViewArray
# Are these changes tested?
Yes by CI
# Are there any user-facing changes?
A few fewer allocations when creating arrays
---------
Co-authored-by: Jeffrey Vo <jeffrey.vo.australia@gmail.com>
1 parent 02af070 commit 237065b
File tree
3 files changed
+46
-14
lines changed- arrow-array/src/array
- arrow-data/src
3 files changed
+46
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
967 | 967 | | |
968 | 968 | | |
969 | 969 | | |
970 | | - | |
971 | | - | |
972 | | - | |
973 | | - | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
974 | 975 | | |
975 | 976 | | |
976 | 977 | | |
977 | 978 | | |
978 | | - | |
| 979 | + | |
979 | 980 | | |
980 | 981 | | |
981 | 982 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
347 | 347 | | |
348 | 348 | | |
349 | 349 | | |
350 | | - | |
351 | | - | |
| 350 | + | |
352 | 351 | | |
353 | | - | |
354 | | - | |
355 | | - | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
356 | 357 | | |
357 | 358 | | |
358 | 359 | | |
359 | 360 | | |
360 | | - | |
| 361 | + | |
361 | 362 | | |
362 | 363 | | |
363 | 364 | | |
364 | 365 | | |
365 | 366 | | |
366 | | - | |
367 | | - | |
368 | | - | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
369 | 370 | | |
370 | 371 | | |
371 | 372 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
309 | 309 | | |
310 | 310 | | |
311 | 311 | | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
312 | 315 | | |
313 | 316 | | |
314 | 317 | | |
| |||
351 | 354 | | |
352 | 355 | | |
353 | 356 | | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
354 | 384 | | |
355 | 385 | | |
356 | 386 | | |
| |||
0 commit comments