Skip to content

[Variant] Add unshred_variant benchmarks - #12079

Merged
sdf-jkl merged 1 commit into
apache:mainfrom
sdf-jkl:unshred-variant-benches
Nov 5, 2026
Merged

sdf-jkl merged 1 commit into
apache:mainfrom
sdf-jkl:unshred-variant-benches

Conversation

@sdf-jkl

@sdf-jkl sdf-jkl commented Nov 4, 2026

Copy link
Copy Markdown
Member

Which issue does this PR close?

Rationale for this change

No benchmark calls unshred_variant, directly or through variant_get, so changes to this kernel can't be compared on the existing suite. #11106 is a current example: it changes how nested fallback values are written, and nothing measures that path.

What changes are included in this PR?

Adds seven unshred_variant benchmarks to variant_kernels, each processing 8,192 rows. The cases are chosen so that a change to one path should not move the others.

Benchmark Rows What it isolates ns/row
unshred_variant_primitive Int64, fully typed Row loop and metadata validation 41
unshred_variant_object {first, last, age}, fully typed Object construction with a small dictionary 406
unshred_variant_partial_object 5 of 15 fields typed, 10 leftover, one sorted 300-name dictionary shared by all rows Merging typed and leftover fields, binary search name lookups 3,354
unshred_variant_partial_object_unsorted_metadata Same documents, unsorted dictionary Linear scan name lookups 18,020
unshred_variant_nested_fallback Field shredded as Int64 holding an object 5 levels deep with 2 fields per object Rebuilding a nested fallback value 10,223
unshred_variant_list List<Float64>, 0 to 100 elements per row Per-element list cost 775
unshred_variant_list_of_objects 8 typed objects per row Objects in lists, repeated name lookups within a row 1,589

Times are medians of 3 Criterion runs on one workstation, to show scale only.

Left out on purpose: the unshredded fast path, because it is a constant-time clone, and other primitive types and metadata encodings, which stayed within about 12 ns and about 5% of these cases in ad hoc runs.

The partial object schema and the JSON-to-variant setup move into small helpers shared with existing benchmarks, and the object fixture can now take its dictionary order. The existing benchmarks keep their names and workloads.

Are these changes tested?

This is benchmark-only. As a check that the suite catches what it is for, applying the source changes from #11106 moves unshred_variant_nested_fallback from 10,223 to 18,917 ns per row (1.85x), while the other six cases stay between 0.99x and 1.03x.

Are there any significant user-facing changes?

No, only benchmark code changes.

🤖 Generated with Claude Code

No benchmark called unshred_variant, directly or through variant_get. Add seven cases to variant_kernels covering primitives, fully typed and partially shredded objects, sorted and unsorted metadata dictionaries, a nested fallback value, and lists.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions github-actions Bot added the parquet-variant parquet-variant* crates label Nov 4, 2026
@sdf-jkl

sdf-jkl commented Nov 4, 2026

Copy link
Copy Markdown
Member Author

@peterxcli @Rich-T-kid @Jefffrey PTAL

@Jefffrey Jefffrey added the development-process Internal changes; PRs with this label are excluded from changelog label Nov 5, 2026

@Rich-T-kid Rich-T-kid 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.

thanks @sdf-jkl

@sdf-jkl
sdf-jkl added this pull request to the merge queue Nov 5, 2026
Merged via the queue into apache:main with commit d34dc3e Nov 5, 2026
23 checks passed
@sdf-jkl
sdf-jkl deleted the unshred-variant-benches branch November 5, 2026 14:55
@sdf-jkl

sdf-jkl commented Nov 5, 2026

Copy link
Copy Markdown
Member Author

Thanks @Jefffrey @Rich-T-kid 🙏

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-variant parquet-variant* crates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants