Skip to content

Minor: reserve space for output views in ByteViewArrayDecoderDictionary #7338

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

alamb
Copy link
Contributor

@alamb alamb commented Mar 26, 2025

Which issue does this PR close?

Rationale for this change

Reserving sufficient space before appending views potentially saves an allocation

What changes are included in this PR?

Reserve sufficient space for the views

Are there any user-facing changes?

Performance is if anything worse 🤔

++ critcmp main alamb_reserve_views
group                                                                          alamb_reserve_views                    main
-----                                                                          -------------------                    ----
arrow_array_reader/StringViewArray/dictionary encoded, mandatory, no NULLs     1.01    244.9±0.37µs        ? ?/sec    1.00   243.0±23.88µs        ? ?/sec
arrow_array_reader/StringViewArray/dictionary encoded, optional, half NULLs    1.21    265.1±4.33µs        ? ?/sec    1.00    219.4±1.12µs        ? ?/sec
arrow_array_reader/StringViewArray/dictionary encoded, optional, no NULLs      1.04    247.5±0.40µs        ? ?/sec    1.00    237.0±3.12µs        ? ?/sec
arrow_array_reader/StringViewArray/plain encoded, mandatory, no NULLs          1.00    388.2±1.69µs        ? ?/sec    1.04    402.1±1.19µs        ? ?/sec
arrow_array_reader/StringViewArray/plain encoded, optional, half NULLs         1.09    337.6±1.74µs        ? ?/sec    1.00    308.4±0.96µs        ? ?/sec
arrow_array_reader/StringViewArray/plain encoded, optional, no NULLs           1.00   397.0±21.83µs        ? ?/sec    1.03    408.9±1.35µs        ? ?/sec

@github-actions github-actions bot added the parquet Changes to the parquet crate label Mar 26, 2025
@alamb alamb force-pushed the alamb/reserve_views branch from d382a25 to db85f2d Compare March 26, 2025 19:43
@alamb

This comment was marked as outdated.

@alamb

This comment was marked as outdated.

1 similar comment
@alamb

This comment was marked as outdated.

@alamb
Copy link
Contributor Author

alamb commented Apr 29, 2025

🤖 ./gh_compare_arrow.sh Benchmark Script Running
Linux aal-dev 6.11.0-1013-gcp #13~24.04.1-Ubuntu SMP Wed Apr 2 16:34:16 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Comparing alamb/reserve_views (557a14c) to 07093a4 diff
BENCH_NAME=arrow_reader
BENCH_COMMAND=cargo bench --all-features --bench arrow_reader
BENCH_FILTER=StringViewArray
BENCH_BRANCH_NAME=alamb_reserve_views
Results will be posted here when complete

@alamb
Copy link
Contributor Author

alamb commented Apr 29, 2025

🤖: Benchmark completed

Details

group                                                                          alamb_reserve_views                    main
-----                                                                          -------------------                    ----
arrow_array_reader/StringViewArray/dictionary encoded, mandatory, no NULLs     1.01   1851.6±7.00µs        ? ?/sec    1.00   1841.3±3.07µs        ? ?/sec
arrow_array_reader/StringViewArray/dictionary encoded, optional, half NULLs    1.01   1759.3±2.30µs        ? ?/sec    1.00   1740.7±3.36µs        ? ?/sec
arrow_array_reader/StringViewArray/dictionary encoded, optional, no NULLs      1.01   1856.0±2.69µs        ? ?/sec    1.00   1846.5±3.25µs        ? ?/sec
arrow_array_reader/StringViewArray/plain encoded, mandatory, no NULLs          1.06   1349.2±5.53µs        ? ?/sec    1.00   1266.9±4.27µs        ? ?/sec
arrow_array_reader/StringViewArray/plain encoded, optional, half NULLs         1.03   1530.4±5.40µs        ? ?/sec    1.00   1488.3±3.95µs        ? ?/sec
arrow_array_reader/StringViewArray/plain encoded, optional, no NULLs           1.07   1366.7±8.17µs        ? ?/sec    1.00   1271.4±7.97µs        ? ?/sec

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
parquet Changes to the parquet crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant