sdf-jkl opened a new pull request, #12079:
URL: https://github.com/apache/arrow-rs/pull/12079
# Which issue does this PR close?
- Part of #11101.
# 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](https://claude.com/claude-code)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]