Skip to content

bench(parquet): cover sub-page value sizes, small page limits, and dictionary fallback - #10836

Merged
Jefffrey merged 1 commit into
apache:mainfrom
pydantic:claude/bench-subpage-window-shapes
Aug 26, 2026
Merged

Jefffrey merged 1 commit into
apache:mainfrom
pydantic:claude/bench-subpage-window-shapes

Conversation

@adriangb

Copy link
Copy Markdown
Contributor

Adds writer benchmarks for three shapes that drive mini-batch windowing and that arrow_writer does not reach.

When a chunk's values do not all fit in the page byte budget, the column writer splits the chunk into mini-batches. On a nullable column, how wide those windows are depends on the ratio between the value size and data_page_size_limit — and the existing suite only samples the two ends of that range.

What is uncovered today

arrow_writer gap
value size ~1 KiB (small_string_*) or 2 MiB against the 1 MiB default (large_string_*) nothing in between, where several values share a page budget
data_page_size_limit always the 1 MiB default a smaller limit reaches a one-value window with far less encoding work per value
how DBA is reached always pinned via set_dictionary_enabled(false) dictionary spilling into DELTA_BYTE_ARRAY, which is how byte-array columns are actually written

What is added

  • subpage_* — 128 KiB and 512 KiB values against the 1 MiB default. The existing case at this size, medium_string_shared_prefix_nullable, is shared-prefix only; the distinct case, where deduplication saves nothing and a narrower window is not paid back, is uncovered. A shared-prefix counterpart at 128 KiB varies only the prefix, so a movement present in one and absent in the other is attributable to that.
  • small_page_limit_* — 64 KiB values against a 64 KiB data_page_size_limit, a realistic setting for selective reads.
  • dictionary_fallback_* — a column that starts dictionary-encoded and becomes DELTA_BYTE_ARRAY only when the dictionary spills, so the windowing changes part-way through the column. pinned_delta_byte_array writes the same data with the dictionary disabled, isolating the dictionary phase and the transition.

plain variants accompany the delta_byte_array ones throughout: PLAIN does not compress a value against its predecessor, so it is insensitive to where a page boundary falls and acts as the control for whether a movement is windowing or the machine.

Notes

New writer_page_windows bench target rather than adding to arrow_writer — that suite is already long enough that a full run has to be split across jobs, and these are heavy (64 MiB written per iteration, sized so times are comparable across value sizes).

Benchmarks only; no library code is touched.

Motivated by #10538 / #10554, where these shapes came up as unmeasured. Landing them separately means both sides of that comparison have them, so the change can be measured on the shapes it actually affects.

…ctionary fallback

The column writer splits a chunk into mini-batches when its values do not all
fit the page byte budget, and on a nullable column how wide those windows are
depends on the ratio between the value size and `data_page_size_limit`.

`arrow_writer` covers the two ends of that range and neither middle. Values are
either ~1 KiB (`small_string_*`, many to a page) or 2 MiB against the 1 MiB
default (`large_string_*`, one value overrunning a page); the limit itself is
never moved; and every `DELTA_BYTE_ARRAY` case pins the encoding with
`set_dictionary_enabled(false)`, so the encoder is DBA from the first value.

Three shapes are added, in a `writer_page_windows` target rather than
`arrow_writer` — that suite already runs long enough to be split across jobs,
and these are heavy.

* `subpage_*`: 128 KiB and 512 KiB values against the 1 MiB default, where
  several values share a page budget. The existing case at this size,
  `medium_string_shared_prefix_nullable`, is shared-prefix only, so the
  distinct case — where deduplication saves nothing and a narrower window is
  not paid back — is uncovered. A shared-prefix counterpart at 128 KiB varies
  only the prefix, so a movement in one and not the other is attributable.

* `small_page_limit_*`: 64 KiB values against a 64 KiB `data_page_size_limit`,
  a realistic setting for selective reads. This reaches a one-value window with
  far less encoding work per value to amortise the per-mini-batch overhead
  against than multi-MiB values do.

* `dictionary_fallback_*`: a column that starts dictionary-encoded and becomes
  `DELTA_BYTE_ARRAY` only when the dictionary spills, which is how byte-array
  columns are written in practice and changes the writer's windowing part-way
  through a column. `pinned_delta_byte_array` writes the same data with the
  dictionary disabled, so the pair isolates the dictionary phase and the
  transition.

`plain` variants accompany the `delta_byte_array` ones throughout. `PLAIN` does
not compress against the previous value, so it is insensitive to where a page
boundary falls and serves as the control for whether a movement is windowing or
the machine.

Co-Authored-By: Claude Opus 5 <[email protected]>
@github-actions github-actions Bot added the parquet parquet crate label Aug 25, 2026
@adriangb
adriangb marked this pull request as ready for review August 25, 2026 12:47
@adriangb

adriangb commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor Author

@etseidl @Jefffrey mind taking a look at these 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 fine to me, thanks @adriangb.

Now that I've caught up on the page index changes, I'll try to get some reviews done tomorrow 🤞

@adriangb

Copy link
Copy Markdown
Contributor Author

Thanks! Reminder that I can't merge PRs here so will wait for you or Andrew.

@Jefffrey Jefffrey added the development-process Internal changes; PRs with this label are excluded from changelog label Aug 26, 2026
@Jefffrey
Jefffrey merged commit f99e34a into apache:main Aug 26, 2026
19 checks passed
@Jefffrey

Copy link
Copy Markdown
Contributor

thanks @adriangb & @etseidl

Rich-T-kid pushed a commit to Rich-T-kid/arrow-rs that referenced this pull request Aug 28, 2026
…ctionary fallback (apache#10836)

Adds writer benchmarks for three shapes that drive **mini-batch
windowing** and that `arrow_writer` does not reach.

When a chunk's values do not all fit in the page byte budget, the column
writer splits the chunk into mini-batches. On a nullable column, how
wide those windows are depends on the ratio between the value size and
`data_page_size_limit` — and the existing suite only samples the two
ends of that range.

## What is uncovered today

| | `arrow_writer` | gap |
| --- | --- | --- |
| value size | ~1 KiB (`small_string_*`) or 2 MiB against the 1 MiB
default (`large_string_*`) | nothing in between, where *several* values
share a page budget |
| `data_page_size_limit` | always the 1 MiB default | a smaller limit
reaches a one-value window with far less encoding work per value |
| how DBA is reached | always pinned via `set_dictionary_enabled(false)`
| dictionary spilling into `DELTA_BYTE_ARRAY`, which is how byte-array
columns are actually written |

## What is added

* **`subpage_*`** — 128 KiB and 512 KiB values against the 1 MiB
default. The existing case at this size,
`medium_string_shared_prefix_nullable`, is shared-prefix only; the
*distinct* case, where deduplication saves nothing and a narrower window
is not paid back, is uncovered. A shared-prefix counterpart at 128 KiB
varies only the prefix, so a movement present in one and absent in the
other is attributable to that.
* **`small_page_limit_*`** — 64 KiB values against a 64 KiB
`data_page_size_limit`, a realistic setting for selective reads.
* **`dictionary_fallback_*`** — a column that starts dictionary-encoded
and becomes `DELTA_BYTE_ARRAY` only when the dictionary spills, so the
windowing changes part-way through the column. `pinned_delta_byte_array`
writes the same data with the dictionary disabled, isolating the
dictionary phase and the transition.

`plain` variants accompany the `delta_byte_array` ones throughout:
`PLAIN` does not compress a value against its predecessor, so it is
insensitive to where a page boundary falls and acts as the control for
whether a movement is windowing or the machine.

## Notes

New `writer_page_windows` bench target rather than adding to
`arrow_writer` — that suite is already long enough that a full run has
to be split across jobs, and these are heavy (64 MiB written per
iteration, sized so times are comparable across value sizes).

Benchmarks only; no library code is touched.

Motivated by apache#10538 / apache#10554, where these shapes came up as unmeasured.
Landing them separately means both sides of that comparison have them,
so the change can be measured on the shapes it actually affects.

Co-authored-by: Claude Opus 5 <[email protected]>
Rich-T-kid pushed a commit to Rich-T-kid/arrow-rs that referenced this pull request Sep 2, 2026
…ctionary fallback (apache#10836)

Adds writer benchmarks for three shapes that drive **mini-batch
windowing** and that `arrow_writer` does not reach.

When a chunk's values do not all fit in the page byte budget, the column
writer splits the chunk into mini-batches. On a nullable column, how
wide those windows are depends on the ratio between the value size and
`data_page_size_limit` — and the existing suite only samples the two
ends of that range.

## What is uncovered today

| | `arrow_writer` | gap |
| --- | --- | --- |
| value size | ~1 KiB (`small_string_*`) or 2 MiB against the 1 MiB
default (`large_string_*`) | nothing in between, where *several* values
share a page budget |
| `data_page_size_limit` | always the 1 MiB default | a smaller limit
reaches a one-value window with far less encoding work per value |
| how DBA is reached | always pinned via `set_dictionary_enabled(false)`
| dictionary spilling into `DELTA_BYTE_ARRAY`, which is how byte-array
columns are actually written |

## What is added

* **`subpage_*`** — 128 KiB and 512 KiB values against the 1 MiB
default. The existing case at this size,
`medium_string_shared_prefix_nullable`, is shared-prefix only; the
*distinct* case, where deduplication saves nothing and a narrower window
is not paid back, is uncovered. A shared-prefix counterpart at 128 KiB
varies only the prefix, so a movement present in one and absent in the
other is attributable to that.
* **`small_page_limit_*`** — 64 KiB values against a 64 KiB
`data_page_size_limit`, a realistic setting for selective reads.
* **`dictionary_fallback_*`** — a column that starts dictionary-encoded
and becomes `DELTA_BYTE_ARRAY` only when the dictionary spills, so the
windowing changes part-way through the column. `pinned_delta_byte_array`
writes the same data with the dictionary disabled, isolating the
dictionary phase and the transition.

`plain` variants accompany the `delta_byte_array` ones throughout:
`PLAIN` does not compress a value against its predecessor, so it is
insensitive to where a page boundary falls and acts as the control for
whether a movement is windowing or the machine.

## Notes

New `writer_page_windows` bench target rather than adding to
`arrow_writer` — that suite is already long enough that a full run has
to be split across jobs, and these are heavy (64 MiB written per
iteration, sized so times are comparable across value sizes).

Benchmarks only; no library code is touched.

Motivated by apache#10538 / apache#10554, where these shapes came up as unmeasured.
Landing them separately means both sides of that comparison have them,
so the change can be measured on the shapes it actually affects.

Co-authored-by: Claude Opus 5 <[email protected]>
Rich-T-kid pushed a commit to Rich-T-kid/arrow-rs that referenced this pull request Sep 18, 2026
…ctionary fallback (apache#10836)

Adds writer benchmarks for three shapes that drive **mini-batch
windowing** and that `arrow_writer` does not reach.

When a chunk's values do not all fit in the page byte budget, the column
writer splits the chunk into mini-batches. On a nullable column, how
wide those windows are depends on the ratio between the value size and
`data_page_size_limit` — and the existing suite only samples the two
ends of that range.

## What is uncovered today

| | `arrow_writer` | gap |
| --- | --- | --- |
| value size | ~1 KiB (`small_string_*`) or 2 MiB against the 1 MiB
default (`large_string_*`) | nothing in between, where *several* values
share a page budget |
| `data_page_size_limit` | always the 1 MiB default | a smaller limit
reaches a one-value window with far less encoding work per value |
| how DBA is reached | always pinned via `set_dictionary_enabled(false)`
| dictionary spilling into `DELTA_BYTE_ARRAY`, which is how byte-array
columns are actually written |

## What is added

* **`subpage_*`** — 128 KiB and 512 KiB values against the 1 MiB
default. The existing case at this size,
`medium_string_shared_prefix_nullable`, is shared-prefix only; the
*distinct* case, where deduplication saves nothing and a narrower window
is not paid back, is uncovered. A shared-prefix counterpart at 128 KiB
varies only the prefix, so a movement present in one and absent in the
other is attributable to that.
* **`small_page_limit_*`** — 64 KiB values against a 64 KiB
`data_page_size_limit`, a realistic setting for selective reads.
* **`dictionary_fallback_*`** — a column that starts dictionary-encoded
and becomes `DELTA_BYTE_ARRAY` only when the dictionary spills, so the
windowing changes part-way through the column. `pinned_delta_byte_array`
writes the same data with the dictionary disabled, isolating the
dictionary phase and the transition.

`plain` variants accompany the `delta_byte_array` ones throughout:
`PLAIN` does not compress a value against its predecessor, so it is
insensitive to where a page boundary falls and acts as the control for
whether a movement is windowing or the machine.

## Notes

New `writer_page_windows` bench target rather than adding to
`arrow_writer` — that suite is already long enough that a full run has
to be split across jobs, and these are heavy (64 MiB written per
iteration, sized so times are comparable across value sizes).

Benchmarks only; no library code is touched.

Motivated by apache#10538 / apache#10554, where these shapes came up as unmeasured.
Landing them separately means both sides of that comparison have them,
so the change can be measured on the shapes it actually affects.

Co-authored-by: Claude Opus 5 <[email protected]>
Rich-T-kid pushed a commit to Rich-T-kid/arrow-rs that referenced this pull request Sep 21, 2026
…ctionary fallback (apache#10836)

Adds writer benchmarks for three shapes that drive **mini-batch
windowing** and that `arrow_writer` does not reach.

When a chunk's values do not all fit in the page byte budget, the column
writer splits the chunk into mini-batches. On a nullable column, how
wide those windows are depends on the ratio between the value size and
`data_page_size_limit` — and the existing suite only samples the two
ends of that range.

## What is uncovered today

| | `arrow_writer` | gap |
| --- | --- | --- |
| value size | ~1 KiB (`small_string_*`) or 2 MiB against the 1 MiB
default (`large_string_*`) | nothing in between, where *several* values
share a page budget |
| `data_page_size_limit` | always the 1 MiB default | a smaller limit
reaches a one-value window with far less encoding work per value |
| how DBA is reached | always pinned via `set_dictionary_enabled(false)`
| dictionary spilling into `DELTA_BYTE_ARRAY`, which is how byte-array
columns are actually written |

## What is added

* **`subpage_*`** — 128 KiB and 512 KiB values against the 1 MiB
default. The existing case at this size,
`medium_string_shared_prefix_nullable`, is shared-prefix only; the
*distinct* case, where deduplication saves nothing and a narrower window
is not paid back, is uncovered. A shared-prefix counterpart at 128 KiB
varies only the prefix, so a movement present in one and absent in the
other is attributable to that.
* **`small_page_limit_*`** — 64 KiB values against a 64 KiB
`data_page_size_limit`, a realistic setting for selective reads.
* **`dictionary_fallback_*`** — a column that starts dictionary-encoded
and becomes `DELTA_BYTE_ARRAY` only when the dictionary spills, so the
windowing changes part-way through the column. `pinned_delta_byte_array`
writes the same data with the dictionary disabled, isolating the
dictionary phase and the transition.

`plain` variants accompany the `delta_byte_array` ones throughout:
`PLAIN` does not compress a value against its predecessor, so it is
insensitive to where a page boundary falls and acts as the control for
whether a movement is windowing or the machine.

## Notes

New `writer_page_windows` bench target rather than adding to
`arrow_writer` — that suite is already long enough that a full run has
to be split across jobs, and these are heavy (64 MiB written per
iteration, sized so times are comparable across value sizes).

Benchmarks only; no library code is touched.

Motivated by apache#10538 / apache#10554, where these shapes came up as unmeasured.
Landing them separately means both sides of that comparison have them,
so the change can be measured on the shapes it actually affects.

Co-authored-by: Claude Opus 5 <[email protected]>
Rich-T-kid pushed a commit to Rich-T-kid/arrow-rs that referenced this pull request Sep 25, 2026
…ctionary fallback (apache#10836)

Adds writer benchmarks for three shapes that drive **mini-batch
windowing** and that `arrow_writer` does not reach.

When a chunk's values do not all fit in the page byte budget, the column
writer splits the chunk into mini-batches. On a nullable column, how
wide those windows are depends on the ratio between the value size and
`data_page_size_limit` — and the existing suite only samples the two
ends of that range.

## What is uncovered today

| | `arrow_writer` | gap |
| --- | --- | --- |
| value size | ~1 KiB (`small_string_*`) or 2 MiB against the 1 MiB
default (`large_string_*`) | nothing in between, where *several* values
share a page budget |
| `data_page_size_limit` | always the 1 MiB default | a smaller limit
reaches a one-value window with far less encoding work per value |
| how DBA is reached | always pinned via `set_dictionary_enabled(false)`
| dictionary spilling into `DELTA_BYTE_ARRAY`, which is how byte-array
columns are actually written |

## What is added

* **`subpage_*`** — 128 KiB and 512 KiB values against the 1 MiB
default. The existing case at this size,
`medium_string_shared_prefix_nullable`, is shared-prefix only; the
*distinct* case, where deduplication saves nothing and a narrower window
is not paid back, is uncovered. A shared-prefix counterpart at 128 KiB
varies only the prefix, so a movement present in one and absent in the
other is attributable to that.
* **`small_page_limit_*`** — 64 KiB values against a 64 KiB
`data_page_size_limit`, a realistic setting for selective reads.
* **`dictionary_fallback_*`** — a column that starts dictionary-encoded
and becomes `DELTA_BYTE_ARRAY` only when the dictionary spills, so the
windowing changes part-way through the column. `pinned_delta_byte_array`
writes the same data with the dictionary disabled, isolating the
dictionary phase and the transition.

`plain` variants accompany the `delta_byte_array` ones throughout:
`PLAIN` does not compress a value against its predecessor, so it is
insensitive to where a page boundary falls and acts as the control for
whether a movement is windowing or the machine.

## Notes

New `writer_page_windows` bench target rather than adding to
`arrow_writer` — that suite is already long enough that a full run has
to be split across jobs, and these are heavy (64 MiB written per
iteration, sized so times are comparable across value sizes).

Benchmarks only; no library code is touched.

Motivated by apache#10538 / apache#10554, where these shapes came up as unmeasured.
Landing them separately means both sides of that comparison have them,
so the change can be measured on the shapes it actually affects.

Co-authored-by: Claude Opus 5 <[email protected]>
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 parquet crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants