Repository navigation
Conversation
Signed-off-by: Matt Katz <mhkatz97@gmail.com>
Signed-off-by: Matt Katz <mhkatz97@gmail.com>
Merging this PR will degrade performance by 1%4 warnings, 1 note
Warning Please fix the performance issues or acknowledge them on CodSpeed. Performance Changes
Tip Investigate this regression by commenting Comparing Footnotes
|
Summary
Adds
rebuild_with_referenced_valid_elementstoListArrayandListViewArray: the same lists over only the elements valid lists reference, with nothing before the first list, after the last, between lists or under a null list. A function that can fail on an element must not see the others;list_transform(#10503) is the first user.Changes
ListArray: slices the elements when only the ends go. When null lists hold elements, it copies the runs of valid lists between them (a filter with the ranges cached on the mask, so it copies range by range) and shifts the offsets in one pass. An array with nothing to drop comes back as it is.ListViewArray: a view not marked zero-copy to a list gets the existingMakeExactrebuild, which already skips null lists. A zero-copy view keeps its layout and only loses its ends, unless a null list holds elements; then it goes through theListArraymethod.Benchmark
list_transformwith a checkedx + 1over 100k lists (~800ki32elements, ~1/8 of the lists null and holding elements), through #10503, median µs, local scratch divan benchmark (runs vary by about ±5%):ListArray::rebuild_with_referenced_valid_elementsarray_transform, same listsTesting
rstestcases for both methods: nothing to drop, leftovers at both ends, null lists holding elements at the start, middle and end, touching ranges, every list null, and for views a gap and lists out of order. Each checks the resulting elements, offsets and sizes, and that the lists read the same as the input.Ran
cargo +nightly-2026-09-10 fmt,cargo clippy -p vortex-array --all-targets --all-features -- -D warnings,cargo nextest run -p vortex-array,cargo test --doc -p vortex-arrayand the CI docs build.Follow-up