Skip to content

benchmarks: ndv benchmarks - #11162

Merged
etseidl merged 2 commits into
apache:mainfrom
Rich-T-kid:rich-T-kid/ndv-benchmarks
Sep 22, 2026
Merged

etseidl merged 2 commits into
apache:mainfrom
Rich-T-kid:rich-T-kid/ndv-benchmarks

Conversation

@Rich-T-kid

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Rationale for this change

set_write_row_group_number_distinct_values was added in #10654 with no benchmarks. This PR adds them so the cost of NDV tracking is visible and regressions are catchable going forward.

What changes are included in this PR?

Adds a bench_ndv benchmark group to parquet/benches/arrow_writer.rs covering the data types that NDV tracking supports: Int32 (primitive), Boolean, Utf8, LargeBinary, and FixedSizeBinary(16).

Each group writes 10 batches of 65,536 rows through a single ArrowWriter with set_write_row_group_number_distinct_values(true). Two cardinality shapes are exercised per type: low (100 distinct values, cycling) and high (all unique, random), since hash-set behaviour differs meaningfully between the two.

Are these changes tested?

n/a

Are there any user-facing changes?

n/a
cargo bench --bench arrow_writer --features arrow/test_utils -- "ndv/"

@github-actions github-actions Bot added the parquet Changes to the parquet crate label Sep 21, 2026
@Rich-T-kid

Copy link
Copy Markdown
Contributor Author

@adriangb mentioned some cool ideas about using bloom filters to potential speed this datafusion. this should be a nice way to track progress

@adriangb

Copy link
Copy Markdown
Contributor

Thanks for setting this up! I’m not a committed so I can’t officially review but I’m generally in favor of adding more benchmarks :)

@etseidl etseidl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. And this time I ran the benches 😅

Thanks @Rich-T-kid

@etseidl
etseidl merged commit 5f38aa5 into apache:main Sep 22, 2026
31 checks passed
@Jefffrey Jefffrey added the development-process Internal changes; PRs with this label are excluded from changelog label Sep 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

development-process Internal changes; PRs with this label are excluded from changelog parquet Changes to the parquet crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Introduce benchmarks for computing NDV in arrow-writer

4 participants