perf: reduce byte array materialization during Arrow export - #9339
Open
ClSlaid wants to merge 3 commits into
Open
perf: reduce byte array materialization during Arrow export#9339ClSlaid wants to merge 3 commits into
ClSlaid wants to merge 3 commits into
Conversation
Signed-off-by: cl <cailue@apache.org>
ClSlaid
force-pushed
the
feat/offset-array/min-materialization
branch
from
August 11, 2026 02:31
8890906 to
b95b97f
Compare
Contributor
Author
|
/cc @robert3005 This PR should restores the performance of #8902, please take a look. And this patch should not be an end, it is just a quick fix, not yet Current |
…y/min-materialization Signed-off-by: cl <cailue@apache.org>
ClSlaid
force-pushed
the
feat/offset-array/min-materialization
branch
from
August 11, 2026 02:48
803a21b to
d512ed9
Compare
Some types does not need that Signed-off-by: cl <cailue@apache.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Important
AI-assisted development disclosure
GPT-5.6 Sol assisted with this PR. A human reviewed the changes.
Validation ran 413 tests. The benchmark suite covers 720 planned scenarios. This value is scenario coverage. It is not source line coverage.
Benchmark results
The end-to-end benchmark reads one Utf8/FSST Vortex file. It exports the same input to Arrow
BinaryArrayandStringArray.Each value is the median wall time for one run.
The new matcher avoids an intermediate canonical
VarBinViewfor both Arrow output types.Representative direct Offset export results:
read_allhas no clear improvement. It returns a top-levelChunkedArray. The old matcher already used the specialized Chunked append path.Purpose
Arrow OffsetArray export can create an intermediate canonical
VarBinView. Some encodings can append directly to the Arrow offset builder. This PR uses the direct path when it is faster.Changes
Dict,Filter,ScalarFn, andSlice.vortex-arrow.vortexcrate.vortex-filefree of Arrow test dependencies.Scenario coverage
The string benchmark defines 180 input scenarios:
The benchmark runs these scenarios through three output paths:
The total is 720 planned scenarios. The file benchmark adds four scenarios. It tests two Arrow output types and two scan collection modes.
Benchmark method
The old and new binaries used the same benchmark source and Cargo profile.
The benchmark created one in-memory Vortex file. The file contained 1,048,576 Utf8 rows in 16 chunks. The default compressor stored each scan batch as FSST. Both output cases read this same file.
The setup created the file before timing started. The timed region performed these steps:
StringArrayorBinaryArray.Each process used CPU 6. Each case used 80 samples. Divan used a minimum time of 2 seconds and a maximum time of 3 seconds. The run order was old/new, new/old, and old/new.
Command:
The direct Offset microbenchmarks ran on the same machine with the standard scheduler.
Known limitation
Some synthetic Zip scenarios are slower. Execution continues through
ScalarFnand stops at its result encoding. FSST Chunked Zip increased from 2.063 ms to 5.519 ms in the largest measured case. The end-to-end file benchmark does not use this lazy Zip path.Benchmark environment
Hardware
powersaveSoftware
bench, 16 codegen units, debug info enabled, LTO disabledThe machine ran a desktop session during the test. The test did not isolate the full system. CPU affinity limited each measured process to one logical CPU.
Validation
cargo nextest run -p vortex-arrow -p vortex-file -p vortex— 413 tests passed.cargo clippy -p vortex-arrow -p vortex --all-targets --all-features— passed.cargo clippy -p vortex --bench string_to_arrow --all-features— passed.cargo +nightly fmt --all -- --check— passed.git diff --check— passed.string_to_arrow --test— all 4 scenarios passed.