Repository navigation
perf(arrow-row): skip the per-element probe when decoding FixedSizeList of fixed-width values - #12540
Mukunth1004 wants to merge 4 commits into
Conversation
…st of fixed-width values decode_fixed_size_list worked out where each element ends by decoding it into a one-row array. Primitive, boolean, null and fixed size binary values all encode to the same length as the null element we already build, so for those types just cut the row into chunks of that width. Closes apache#12537
|
run benchmark row_format |
|
🤖 Benchmark starting (GKE) | trigger Target: row_format Sharding factor: 1 (1 workers). Comparing 5920f05 (5920f05) to bfc4f2a diff Run configurationrun benchmark row_format
baseline:
ref: bfc4f2af8c0bcbe116b41d8746c4f3eef2b18b9d
changed:
ref: 5920f0548dd0a18f3aab147b54f5094e733f6d87
env:
BENCH_FILTER: ^convert_rows .*fixed_size_list
shards: 1
Trigger commentResults will be posted when all workers finish. File an issue against this benchmark runner |
|
🤖 Benchmark completed (GKE) | trigger Target: row_format Comparing 5920f05 (5920f05) to bfc4f2a diff Run configurationrun benchmark row_format
baseline:
ref: bfc4f2af8c0bcbe116b41d8746c4f3eef2b18b9d
changed:
ref: 5920f0548dd0a18f3aab147b54f5094e733f6d87
env:
BENCH_FILTER: ^convert_rows .*fixed_size_list
shards: 1
Trigger commentDetailsPer-runner informationrow_format — shard 1/1Node: gk3-benchmark-cluster-nap-14njlul2-a02a5789-2fpw Instance: c4a-highmem-16 (12 vCPU / 65 GiB) uname: BENCH_COMMAND: cargo bench --features=arrow,async,test_common,experimental,object_store --bench row_formatCPU Details (lscpu)Resource Usagebase (merge-base)
branch
File an issue against this benchmark runner |
|
Thanks for running the benchmark @Rich-T-kid! The CI numbers are even better than what I measured locally (78x vs ~51x for 8 elements, 92x vs ~28x for 768), and utf8 is unchanged as expected. Whenever a maintainer has a moment, could someone approve the CI workflow run? It's my first PR here, so it's waiting on approval. Happy to address any review feedback. |
Rich-T-kid
left a comment
There was a problem hiding this comment.
benchmarks look strong & the PR makes sense to me
|
@Mukunth1004 can you enable the CI on your fork |
|
Done, I've enabled CI on my fork and started a run on this branch. Thanks for the review @Rich-T-kid ! |
|
Pushed a one-line test fix: typos flagged the fixture string b"abd", swapped it for b"abx". Fork CI re-running. @Rich-T-kid |
|
Fork CI can't start here: the jobs fail with "The job was not acquired by Runner of type hosted even after multiple attempts" (the workflow uses ubuntu-slim). Locally typos, cargo fmt --check, clippy -D warnings for arrow-row/arrow, and the arrow-row tests all pass. Could a maintainer approve the upstream workflow run instead? |
|
running workflow |
Which issue does this PR close?
Rationale for this change
decode_fixed_size_listfinds where each element of a valid row ends bydecoding it into a throwaway one-row array (
convert_rawper element). For aFixedSizeList(Float32, 768)that is 768 array builds per row. For elementtypes whose row encoding has a fixed width, every element (null or not) is as
long as the encoded null element the function already computes, so the probe
is not needed.
What changes are included in this PR?
Two commits:
chore(arrow): addsrow_formatbenchmarks forFixedSizeList(f32 x 8 andf32 x 768, plus utf8 x 8 as a variable-width control). Use this commit as
baseline.ref.perf(arrow-row): when the element type is primitive,Boolean,NullorFixedSizeBinary, cut each valid row intovalue_lengthchunks of thenull element's encoded width with
chunks_exact, and sizechild_rowsup front. Other element types keep the existing loop.
No public API change.
The variable-width path (the issue's second suggestion) is left for a separate PR.
Are these changes tested?
Existing
FixedSizeListtests exercise the new path (Int32, Null, two adjacentlists). Added
test_fixed_size_list_of_fixed_width_values, which round-tripsBoolean, Float32 (incl. NaN and -0.0), Decimal128, FixedSizeBinary and Null
elements with list-level and element-level nulls, under all four sort option
combinations, followed by a second column to check the row is advanced
correctly.
Benchmarks (
cargo bench -p arrow --features test_utils --bench row_format -- "convert_rows .*fixed_size_list",local Linux machine, shared, so expect some noise):
No input gets slower: variable-width elements take the unchanged path.
Are there any significant user-facing changes?
No.
AI usage disclosure
Claude Code assisted with investigating the issue and developing the implementation and tests. I reviewed the changes, verified the test results and benchmarks, and understand the implementation. I'll take responsibility for addressing review feedback and maintaining this contribution.