Skip to content

perf(arrow-row): skip the per-element probe when decoding FixedSizeList of fixed-width values - #1

Closed
Mukunth1004 wants to merge 2 commits into
mainfrom
fix/12537-fixed-size-list-row-decode
Closed

Mukunth1004 wants to merge 2 commits into
mainfrom
fix/12537-fixed-size-list-row-decode

Conversation

@Mukunth1004

@Mukunth1004 Mukunth1004 commented Dec 3, 2026 •

Copy link
Copy Markdown
Owner

Review copy, inside Mukunth1004's fork only. Not sent to Apache yet. Upstream issue: apache/arrow-rs issue 12537 (left as plain text so Apache gets no notification).
When this looks right, say go and the same branch is opened as a PR to apache/arrow-rs with the text below. Please rewrite the AI usage disclosure section in your own words first.


Which issue does this PR close?

  • Closes #12537

Rationale for this change

decode_fixed_size_list finds where each element of a valid row ends by
decoding it into a throwaway one-row array (convert_raw per element). For a
FixedSizeList(Float32, 768) that is 768 array builds per row. For element
types 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:

  1. chore(arrow): adds row_format benchmarks for FixedSizeList (f32 x 8 and
    f32 x 768, plus utf8 x 8 as a variable-width control). Use this commit as
    baseline.ref.
  2. perf(arrow-row): when the element type is primitive, Boolean, Null or
    FixedSizeBinary, cut each valid row into value_length chunks of the
    null element's encoded width with chunks_exact, and size child_rows
    up 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 FixedSizeList tests exercise the new path (Int32, Null, two adjacent
lists). Added test_fixed_size_list_of_fixed_width_values, which round-trips
Boolean, 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):

benchmark before after change
convert_rows 4096 fixed_size_list(8) of f32(0) 6.23 ms 123 µs -98.0%
convert_rows 1024 fixed_size_list(768) of f32(0) 153.5 ms 5.57 ms -96.4%
convert_rows 4096 fixed_size_list(8) of utf8(10, 0) 9.21 ms 9.18 ms no change

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.

…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
@Mukunth1004
Mukunth1004 force-pushed the fix/12537-fixed-size-list-row-decode branch from 080c704 to 5920f05 Compare December 3, 2026 07:12
@Mukunth1004

Copy link
Copy Markdown
Owner Author

Opened upstream as apache#12540.

@Mukunth1004 Mukunth1004 closed this Dec 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant