Commit 1c397a9
authored
Add specialized coalesce path for PrimitiveArrays (#7772)
# Which issue does this PR close?
- Closes #7763
# Rationale for this change
I want the `coalesce` operation to be as fast as possible
# What changes are included in this PR?
Add specialied `InProgressPrimitiveArray` that avoids keeping a second
copy of the primitive arrays that are concat'ed together
I don't expect this will make a huge performance difference -- but it is
needed to implement #7762 which
I do expect to make a difference
Update: it turns out this seems to improve performance quite a bit (25%)
for highly selective kernels. I speculare this is due to not having to
keep around many small allocations to hold intermediate `ArrayRef`s
# Are these changes tested?
There are already existing tests for u32s which cover this code path. I
also added a test for StringArray which ensures the generic in progress
array is still covered.
I also checked coverage using
```shell
cargo llvm-cov --html -p arrow-select -p arrow-data
```
# Are there any user-facing changes?
No, this is an internal optimization only1 parent 0de463e commit 1c397a9
2 files changed
+168
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| 38 | + | |
37 | 39 | | |
38 | 40 | | |
39 | 41 | | |
| |||
322 | 324 | | |
323 | 325 | | |
324 | 326 | | |
325 | | - | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
326 | 336 | | |
327 | 337 | | |
328 | 338 | | |
| |||
364 | 374 | | |
365 | 375 | | |
366 | 376 | | |
367 | | - | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
368 | 380 | | |
369 | 381 | | |
370 | 382 | | |
| |||
456 | 468 | | |
457 | 469 | | |
458 | 470 | | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
459 | 492 | | |
460 | 493 | | |
461 | 494 | | |
| |||
941 | 974 | | |
942 | 975 | | |
943 | 976 | | |
944 | | - | |
| 977 | + | |
| 978 | + | |
945 | 979 | | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
946 | 988 | | |
947 | 989 | | |
948 | | - | |
949 | | - | |
950 | | - | |
951 | | - | |
952 | | - | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
953 | 1008 | | |
954 | 1009 | | |
955 | 1010 | | |
| |||
960 | 1015 | | |
961 | 1016 | | |
962 | 1017 | | |
963 | | - | |
964 | | - | |
965 | | - | |
966 | | - | |
967 | | - | |
| 1018 | + | |
| 1019 | + | |
968 | 1020 | | |
969 | 1021 | | |
970 | | - | |
| 1022 | + | |
971 | 1023 | | |
972 | 1024 | | |
973 | 1025 | | |
| |||
| 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 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
0 commit comments