Skip to content

perf(parquet-variant): Avoid intermediate string allocations in JSON serialization - #11402

Merged
Rich-T-kid merged 4 commits into
apache:mainfrom
rizzabhdwaj:string_alloc_11396
Oct 26, 2026
Merged

Rich-T-kid merged 4 commits into
apache:mainfrom
rizzabhdwaj:string_alloc_11396

Conversation

@rizzabhdwaj

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Rationale for this change

Avoid unnecessary temporary String allocations when serializing JSON values by writing directly to the output buffer.

What changes are included in this PR?

  • Use serde_json::to_writer for direct JSON serialization.
  • Avoid unnecessary intermediate String allocations and copies.
  • Preserve the existing JSON escaping and serialization behavior.

@github-actions github-actions Bot added the parquet-variant parquet-variant* crates label Oct 6, 2026
@Jefffrey Jefffrey changed the title fixing issue 11396 perf(parquet-variant): Avoid intermediate string allocations in JSON serialization Oct 7, 2026
Comment thread parquet-variant-json/src/to_json.rs Resolved
@Jefffrey Jefffrey added the performance Speed or memory optimizations label Oct 7, 2026

@sdf-jkl sdf-jkl left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks @rishabh1244 looks clean. Should be ready once you address @Jefffrey's suggestion.

I want to work on the bench to measure variant_to_json -- #10906. If I make it soon enough we'd be able to measure your improvement

@Jefffrey Jefffrey 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.

functionally looks good, should be good to go once we can get some numbers per above comment

DKER2 pushed a commit to DKER2/arrow-rs that referenced this pull request Oct 25, 2026
# Which issue does this PR close?

- Part of apache#10906
- Supports benchmarking apache#11402

# Rationale for this change

`variant_kernels.rs` benchmarks `json_to_variant` and `variant_get`, but
has no coverage for `variant_to_json`. Add benchmarks to track
serialization performance and evaluate changes such as avoiding
temporary string allocations in apache#11402.

# What changes are included in this PR?

Add seven `variant_to_json` benchmarks, each processing 8,192 rows:

- Integer scalars and the same values in shredded form.
- Small objects containing two strings and an integer.
- The same small objects with dictionary and run-end-encoded metadata.
- Wide objects using the existing seeded generator with 200 entries per
object and mixed scalar values.
- Numeric lists with 0–100 elements.

Reuse existing fixture generators and the shared row-count constant.
Fixture construction and metadata encoding happen outside the timed
loops.

# Are these changes tested?

All seven cases passed a smoke run and completed a release-mode
Criterion run with 100 samples each. Compilation, formatting, and
spelling checks pass. Clippy with the installed stable toolchain
encounters existing lint errors in `arrow-data`.

# Are there any significant user-facing changes?

No.

AI assistance: OpenAI Codex helped implement and refine the benchmarks,
run local validation, and draft this description.
@Rich-T-kid

Copy link
Copy Markdown
Contributor

run benchmark variant_kernels

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark starting (GKE) | trigger

Target: variant_kernels

Sharding factor: 1 (1 workers).

Comparing string_alloc_11396 (d87f45b) to a9b8d27 (merge-base) diff

Run configuration
run benchmark variant_kernels
shards: 1

Results will be posted when all workers finish.


File an issue against this benchmark runner

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark completed (GKE) | trigger

Target: variant_kernels

Comparing string_alloc_11396 (d87f45b) to a9b8d27 (merge-base) diff

Run configuration
run benchmark variant_kernels
shards: 1
Details
group                                                                                             base                                   changed
-----                                                                                             ----                                   -------
batch_json_string_to_variant duplicate_key_100k (100014 bytes per document, 10 rows)              1.00    141.4±0.09µs        ? ?/sec    1.00    140.8±0.15µs        ? ?/sec
batch_json_string_to_variant escaped_strings (58 bytes per document, 8000 rows)                   1.00      6.7±0.02ms        ? ?/sec    1.02      6.8±0.10ms        ? ?/sec
batch_json_string_to_variant fixed_point_decimals (65 bytes per document, 8000 rows)              1.00      6.4±0.03ms        ? ?/sec    1.04      6.7±0.05ms        ? ?/sec
batch_json_string_to_variant int32 (16 bytes per document, 8000 rows)                             1.00      2.9±0.02ms        ? ?/sec    1.01      2.9±0.02ms        ? ?/sec
batch_json_string_to_variant json_list 8k string                                                  1.00     19.0±0.07ms        ? ?/sec    1.05     20.0±0.47ms        ? ?/sec
batch_json_string_to_variant large_array_1024 (4011 bytes per document, 261 rows)                 1.00      9.0±0.05ms        ? ?/sec    1.03      9.3±0.23ms        ? ?/sec
batch_json_string_to_variant large_string_8k (8214 bytes per document, 127 rows)                  1.00    266.1±1.47µs        ? ?/sec    1.00    266.5±0.72µs        ? ?/sec
batch_json_string_to_variant object - 1 depth(100 fields) random_json(2436 bytes per document)    1.00    148.0±0.66ms        ? ?/sec    1.00    147.5±1.09ms        ? ?/sec
batch_json_string_to_variant object - 1 depth(200 fields) random_json(4871 bytes per document)    1.00    310.2±1.66ms        ? ?/sec    1.00    309.2±1.58ms        ? ?/sec
batch_json_string_to_variant random_json(2633 bytes per document)                                 1.00    218.4±0.27ms        ? ?/sec    1.01    220.3±0.86ms        ? ?/sec
batch_json_string_to_variant repeated_struct 8k string                                            1.00      6.2±0.03ms        ? ?/sec    1.03      6.3±0.06ms        ? ?/sec
shred_variant_partial_object_8k_rows                                                              1.00     20.8±0.10ms        ? ?/sec    1.02     21.1±0.37ms        ? ?/sec
shred_variant_unmatched_object_8k_rows                                                            1.00     26.0±0.15ms        ? ?/sec    1.01     26.3±0.44ms        ? ?/sec
variant_array_builder_build_262k_small_values                                                     1.04      2.6±0.04ms        ? ?/sec    1.00      2.5±0.04ms        ? ?/sec
variant_get_binary_from_string                                                                    1.00    478.8±0.53µs        ? ?/sec    1.01    482.4±0.60µs        ? ?/sec
variant_get_binary_from_unshredded_binary                                                         1.00    460.1±3.26µs        ? ?/sec    1.01    463.6±3.65µs        ? ?/sec
variant_get_decimal_double_to_decimal128(20,3)_non_finite_8192_safe                               1.00    497.9±1.81µs        ? ?/sec    1.01    501.5±1.12µs        ? ?/sec
variant_get_decimal_double_to_decimal128(20,3)_valid_8192_safe                                    1.01   520.4±17.43µs        ? ?/sec    1.00    515.2±1.61µs        ? ?/sec
variant_get_decimal_double_to_decimal128(20,3)_valid_8192_strict                                  1.01   547.6±23.22µs        ? ?/sec    1.00    543.6±1.61µs        ? ?/sec
variant_get_decimal_double_to_decimal256(40,-2)_scale_down_8192_safe                              1.05   961.0±49.54µs        ? ?/sec    1.00    911.3±2.57µs        ? ?/sec
variant_get_decimal_double_to_decimal64(3,0)_precision_overflow_8192_safe                         1.00    438.7±1.09µs        ? ?/sec    1.00    437.9±0.84µs        ? ?/sec
variant_get_decimal_float_to_decimal32(7,2)_valid_8192_safe                                       1.00    455.8±1.92µs        ? ?/sec    1.00    455.2±1.46µs        ? ?/sec
variant_get_decimal_float_to_decimal32(7,2)_valid_8192_strict                                     1.00    502.8±1.78µs        ? ?/sec    1.00    501.7±2.38µs        ? ?/sec
variant_get_decimal_float_to_decimal64(3,0)_precision_overflow_8192_safe                          1.00    451.7±1.44µs        ? ?/sec    1.00    452.3±1.17µs        ? ?/sec
variant_get_decimal_int32_to_decimal32(8,0)_precision_overflow_8192_safe                          1.00    486.0±1.32µs        ? ?/sec    1.00    485.6±1.18µs        ? ?/sec
variant_get_decimal_int32_to_decimal32(9,0)_valid_8192_safe                                       1.00    468.9±1.19µs        ? ?/sec    1.00    471.2±1.16µs        ? ?/sec
variant_get_decimal_int32_to_decimal32(9,0)_valid_8192_strict                                     1.00    510.2±1.59µs        ? ?/sec    1.00    511.1±2.33µs        ? ?/sec
variant_get_decimal_int64_to_decimal128(38,2)_scale_up_8192_safe                                  1.02   530.7±28.65µs        ? ?/sec    1.00    521.1±1.60µs        ? ?/sec
variant_get_decimal_int64_to_decimal128(38,2)_scale_up_8192_strict                                1.02   577.2±37.95µs        ? ?/sec    1.00    566.3±2.98µs        ? ?/sec
variant_get_decimal_int64_to_decimal256(76,-1)_scale_down_8192_safe                               1.02   540.4±30.69µs        ? ?/sec    1.00    529.6±1.23µs        ? ?/sec
variant_get_decimal_int64_to_decimal32(9,-1)_scale_before_narrowing_8192_safe                     1.00    480.7±0.78µs        ? ?/sec    1.00    481.0±0.82µs        ? ?/sec
variant_get_decimal_int64_to_decimal32(9,-20)_all_zero_8192_safe                                  1.01   492.3±14.88µs        ? ?/sec    1.00    486.7±0.65µs        ? ?/sec
variant_get_list_index_all_oob_int64_64_rows                                                      1.00  1787.9±41.11ns        ? ?/sec    1.00  1786.4±44.39ns        ? ?/sec
variant_get_list_index_shredded                                                                   1.02     46.1±1.59µs        ? ?/sec    1.00     45.1±1.24µs        ? ?/sec
variant_get_list_index_unshredded                                                                 1.01  1002.6±13.97µs        ? ?/sec    1.00   994.2±12.15µs        ? ?/sec
variant_get_primitive                                                                             1.00   563.5±10.28ns        ? ?/sec    1.00    565.4±3.93ns        ? ?/sec
variant_get_shredded_utf8                                                                         1.00   720.3±11.37ns        ? ?/sec    1.01    725.0±4.90ns        ? ?/sec
variant_get_unshredded_object_path_262k_rows                                                      1.00     37.1±0.53ms        ? ?/sec    1.02     37.8±0.43ms        ? ?/sec
variant_get_utf8_from_date                                                                        1.00    569.6±5.20µs        ? ?/sec    1.00    567.2±5.02µs        ? ?/sec
variant_get_utf8_from_decimal                                                                     1.00    473.0±6.45µs        ? ?/sec    1.00    474.0±5.86µs        ? ?/sec
variant_get_utf8_from_float                                                                       1.00    442.5±1.07µs        ? ?/sec    1.01    446.7±1.37µs        ? ?/sec
variant_get_utf8_from_int                                                                         1.00    445.1±1.03µs        ? ?/sec    1.00    446.7±1.24µs        ? ?/sec
variant_get_utf8_from_list                                                                        1.00   647.1±11.46µs        ? ?/sec    1.00   646.0±11.03µs        ? ?/sec
variant_get_utf8_from_map_in_list                                                                 1.00   676.8±12.77µs        ? ?/sec    1.00   673.8±12.62µs        ? ?/sec
variant_get_utf8_from_time                                                                        1.01    786.9±2.01µs        ? ?/sec    1.00    781.6±1.37µs        ? ?/sec
variant_get_utf8_from_timestamp_with_timezone                                                     1.00    570.7±2.97µs        ? ?/sec    1.00    568.8±2.89µs        ? ?/sec
variant_get_utf8_from_timestamp_without_timezone                                                  1.00    570.3±3.04µs        ? ?/sec    1.00    568.5±2.95µs        ? ?/sec
variant_get_utf8_from_unshredded_string                                                           1.00    495.2±1.81µs        ? ?/sec    1.00    496.5±1.38µs        ? ?/sec

Per-runner information
variant_kernels — shard 1/1

Node: gk3-benchmark-cluster-nap-2hx8ema4-917ada51-b8mp

Instance: c4a-highmem-16 (12 vCPU / 65 GiB)

uname:

Linux bench-c6403977461-3852-crvbw 6.12.105+ #1 SMP Sat Sep  5 07:54:11 UTC 2026 aarch64 GNU/Linux

BENCH_COMMAND:

cargo bench --features=arrow,async,test_common,experimental,object_store --bench variant_kernels
CPU Details (lscpu)
Architecture:                            aarch64
CPU op-mode(s):                          64-bit
Byte Order:                              Little Endian
CPU(s):                                  16
On-line CPU(s) list:                     0-15
Vendor ID:                               ARM
Model name:                              Neoverse-V2
Model:                                   1
Thread(s) per core:                      1
Core(s) per cluster:                     16
Socket(s):                               -
Cluster(s):                              1
Stepping:                                r0p1
BogoMIPS:                                2000.00
Flags:                                   fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti
L1d cache:                               1 MiB (16 instances)
L1i cache:                               1 MiB (16 instances)
L2 cache:                                32 MiB (16 instances)
L3 cache:                                80 MiB (1 instance)
NUMA node(s):                            1
NUMA node0 CPU(s):                       0-15
Vulnerability Gather data sampling:      Not affected
Vulnerability Indirect target selection: Not affected
Vulnerability Itlb multihit:             Not affected
Vulnerability L1tf:                      Not affected
Vulnerability Mds:                       Not affected
Vulnerability Meltdown:                  Not affected
Vulnerability Mmio stale data:           Not affected
Vulnerability Reg file data sampling:    Not affected
Vulnerability Retbleed:                  Not affected
Vulnerability Spec rstack overflow:      Not affected
Vulnerability Spec store bypass:         Mitigation; Speculative Store Bypass disabled via prctl
Vulnerability Spectre v1:                Mitigation; __user pointer sanitization
Vulnerability Spectre v2:                Mitigation; CSV2, BHB
Vulnerability Srbds:                     Not affected
Vulnerability Tsa:                       Not affected
Vulnerability Tsx async abort:           Not affected
Vulnerability Vmscape:                   Not affected
Resource Usage

base (merge-base)

Metric Value
Wall time 585.1s
Peak memory 447.1 MiB
Avg memory 291.1 MiB
CPU user 573.7s
CPU sys 5.8s
Peak spill 0 B

branch

Metric Value
Wall time 590.1s
Peak memory 448.3 MiB
Avg memory 290.4 MiB
CPU user 579.5s
CPU sys 5.2s
Peak spill 0 B

File an issue against this benchmark runner

@Rich-T-kid

Copy link
Copy Markdown
Contributor

run benchmark variant_kernels

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark starting (GKE) | trigger

Target: variant_kernels

Sharding factor: 1 (1 workers).

Comparing string_alloc_11396 (00c5a4c) to a2c6898 (merge-base) diff

Run configuration
run benchmark variant_kernels
shards: 1

Results will be posted when all workers finish.


File an issue against this benchmark runner

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark completed (GKE) | trigger

Target: variant_kernels

Comparing string_alloc_11396 (00c5a4c) to a2c6898 (merge-base) diff

Run configuration
run benchmark variant_kernels
shards: 1
Details
group                                                                                             base                                   changed
-----                                                                                             ----                                   -------
batch_json_string_to_variant duplicate_key_100k (100014 bytes per document, 10 rows)              1.00    147.3±0.26µs        ? ?/sec    1.01    148.9±0.16µs        ? ?/sec
batch_json_string_to_variant escaped_strings (58 bytes per document, 8000 rows)                   1.00      7.2±0.02ms        ? ?/sec    1.01      7.3±0.05ms        ? ?/sec
batch_json_string_to_variant fixed_point_decimals (65 bytes per document, 8000 rows)              1.00      6.9±0.02ms        ? ?/sec    1.01      7.0±0.04ms        ? ?/sec
batch_json_string_to_variant int32 (16 bytes per document, 8000 rows)                             1.00      3.0±0.01ms        ? ?/sec    1.02      3.1±0.02ms        ? ?/sec
batch_json_string_to_variant json_list 8k string                                                  1.00     19.6±0.06ms        ? ?/sec    1.03     20.2±0.23ms        ? ?/sec
batch_json_string_to_variant large_array_1024 (4011 bytes per document, 261 rows)                 1.00      9.0±0.03ms        ? ?/sec    1.03      9.3±0.20ms        ? ?/sec
batch_json_string_to_variant large_string_8k (8214 bytes per document, 127 rows)                  1.00    266.8±0.67µs        ? ?/sec    1.01    268.3±0.77µs        ? ?/sec
batch_json_string_to_variant object - 1 depth(100 fields) random_json(2436 bytes per document)    1.00    155.1±1.11ms        ? ?/sec    1.00    155.6±0.45ms        ? ?/sec
batch_json_string_to_variant object - 1 depth(200 fields) random_json(4871 bytes per document)    1.00    307.1±2.30ms        ? ?/sec    1.00    307.8±1.00ms        ? ?/sec
batch_json_string_to_variant random_json(2633 bytes per document)                                 1.00    226.6±0.22ms        ? ?/sec    1.00    227.3±0.66ms        ? ?/sec
batch_json_string_to_variant repeated_struct 8k string                                            1.00      6.6±0.01ms        ? ?/sec    1.02      6.7±0.03ms        ? ?/sec
shred_variant_partial_object_8k_rows                                                              1.02     21.9±0.04ms        ? ?/sec    1.00     21.5±0.08ms        ? ?/sec
shred_variant_unmatched_object_8k_rows                                                            1.00     27.3±0.06ms        ? ?/sec    1.00     27.3±0.08ms        ? ?/sec
variant_array_builder_build_262k_small_values                                                     1.02  1120.1±50.47µs        ? ?/sec    1.00  1098.7±69.98µs        ? ?/sec
variant_get_binary_from_string                                                                    1.00    477.9±0.74µs        ? ?/sec    1.01    483.7±1.03µs        ? ?/sec
variant_get_binary_from_unshredded_binary                                                         1.00    460.3±3.26µs        ? ?/sec    1.02    468.5±3.72µs        ? ?/sec
variant_get_decimal_double_to_decimal128(20,3)_non_finite_8192_safe                               1.00    507.1±1.64µs        ? ?/sec    1.01    514.6±1.74µs        ? ?/sec
variant_get_decimal_double_to_decimal128(20,3)_valid_8192_safe                                    1.00    523.7±1.44µs        ? ?/sec    1.01    528.9±2.30µs        ? ?/sec
variant_get_decimal_double_to_decimal128(20,3)_valid_8192_strict                                  1.00    545.6±1.17µs        ? ?/sec    1.02    556.7±3.49µs        ? ?/sec
variant_get_decimal_double_to_decimal256(40,-2)_scale_down_8192_safe                              1.01   1024.6±6.20µs        ? ?/sec    1.00   1014.4±4.00µs        ? ?/sec
variant_get_decimal_double_to_decimal64(3,0)_precision_overflow_8192_safe                         1.00    503.5±0.98µs        ? ?/sec    1.01    508.3±2.01µs        ? ?/sec
variant_get_decimal_float_to_decimal32(7,2)_valid_8192_safe                                       1.00    471.5±1.42µs        ? ?/sec    1.01    475.8±1.17µs        ? ?/sec
variant_get_decimal_float_to_decimal32(7,2)_valid_8192_strict                                     1.00    511.7±1.31µs        ? ?/sec    1.01    517.2±1.98µs        ? ?/sec
variant_get_decimal_float_to_decimal64(3,0)_precision_overflow_8192_safe                          1.00    514.2±1.08µs        ? ?/sec    1.01    520.4±1.90µs        ? ?/sec
variant_get_decimal_int32_to_decimal32(8,0)_precision_overflow_8192_safe                          1.00    482.4±1.15µs        ? ?/sec    1.01    486.4±1.40µs        ? ?/sec
variant_get_decimal_int32_to_decimal32(9,0)_valid_8192_safe                                       1.00    470.2±1.26µs        ? ?/sec    1.01    472.7±1.60µs        ? ?/sec
variant_get_decimal_int32_to_decimal32(9,0)_valid_8192_strict                                     1.00    508.2±2.27µs        ? ?/sec    1.01    513.5±2.93µs        ? ?/sec
variant_get_decimal_int64_to_decimal128(38,2)_scale_up_8192_safe                                  1.00    516.8±2.52µs        ? ?/sec    1.01    521.6±3.27µs        ? ?/sec
variant_get_decimal_int64_to_decimal128(38,2)_scale_up_8192_strict                                1.00    561.1±3.99µs        ? ?/sec    1.02    574.2±3.21µs        ? ?/sec
variant_get_decimal_int64_to_decimal256(76,-1)_scale_down_8192_safe                               1.03    546.0±1.57µs        ? ?/sec    1.00    532.5±2.91µs        ? ?/sec
variant_get_decimal_int64_to_decimal32(9,-1)_scale_before_narrowing_8192_safe                     1.00    480.1±0.91µs        ? ?/sec    1.00    482.1±1.34µs        ? ?/sec
variant_get_decimal_int64_to_decimal32(9,-20)_all_zero_8192_safe                                  1.00    466.3±0.96µs        ? ?/sec    1.01    468.7±2.20µs        ? ?/sec
variant_get_decimal_short_string_to_decimal256(40,-2)_scale_down_8192_safe                        1.00    582.6±2.47µs        ? ?/sec    1.00    581.4±3.26µs        ? ?/sec
variant_get_decimal_short_string_to_decimal256(76,2)_wide_8192_safe                               1.00    960.4±3.46µs        ? ?/sec    1.00    957.1±3.51µs        ? ?/sec
variant_get_decimal_short_string_to_decimal32(7,2)_valid_8192_safe                                1.00    551.2±2.51µs        ? ?/sec    1.00    553.5±3.31µs        ? ?/sec
variant_get_decimal_short_string_to_decimal32(7,2)_valid_8192_strict                              1.00    600.9±7.83µs        ? ?/sec    1.00    602.7±8.07µs        ? ?/sec
variant_get_decimal_string_to_decimal128(38,3)_long_8192_safe                                     1.00   1102.9±6.36µs        ? ?/sec    1.01   1111.7±7.59µs        ? ?/sec
variant_get_decimal_string_to_decimal128(38,3)_long_8192_strict                                   1.00  1175.9±12.20µs        ? ?/sec    1.01  1186.5±13.10µs        ? ?/sec
variant_get_list_index_all_oob_int64_64_rows                                                      1.01  1806.4±45.92ns        ? ?/sec    1.00  1787.1±43.56ns        ? ?/sec
variant_get_list_index_shredded                                                                   1.04     47.1±1.26µs        ? ?/sec    1.00     45.2±1.23µs        ? ?/sec
variant_get_list_index_unshredded                                                                 1.00  1039.3±16.06µs        ? ?/sec    1.00  1043.1±17.67µs        ? ?/sec
variant_get_object_path_metadata/json_to_variant                                                  1.12      3.6±0.07ms        ? ?/sec    1.00      3.2±0.08ms        ? ?/sec
variant_get_object_path_metadata/per_row_metadata                                                 1.14      3.3±0.08ms        ? ?/sec    1.00      2.9±0.05ms        ? ?/sec
variant_get_object_path_metadata/variant_array_builder                                            1.06      3.2±0.09ms        ? ?/sec    1.00      3.0±0.07ms        ? ?/sec
variant_get_primitive                                                                             1.00    560.3±4.91ns        ? ?/sec    1.02    573.8±7.63ns        ? ?/sec
variant_get_shredded_utf8                                                                         1.00    725.3±9.90ns        ? ?/sec    1.00    727.5±5.02ns        ? ?/sec
variant_get_unshredded_object_path_262k_rows                                                      1.00     37.4±0.53ms        ? ?/sec    1.06     39.5±0.70ms        ? ?/sec
variant_get_utf8_from_date                                                                        1.00    571.3±4.88µs        ? ?/sec    1.00    570.6±4.89µs        ? ?/sec
variant_get_utf8_from_decimal                                                                     1.00    474.5±6.38µs        ? ?/sec    1.00    476.8±6.23µs        ? ?/sec
variant_get_utf8_from_float                                                                       1.00    448.6±1.39µs        ? ?/sec    1.00    450.6±1.65µs        ? ?/sec
variant_get_utf8_from_int                                                                         1.00    448.6±1.30µs        ? ?/sec    1.01    451.5±1.65µs        ? ?/sec
variant_get_utf8_from_list                                                                        1.03   667.4±12.32µs        ? ?/sec    1.00   648.9±12.27µs        ? ?/sec
variant_get_utf8_from_map_in_list                                                                 1.01   694.6±12.46µs        ? ?/sec    1.00   687.3±12.84µs        ? ?/sec
variant_get_utf8_from_time                                                                        1.00    783.8±2.27µs        ? ?/sec    1.00    781.5±1.73µs        ? ?/sec
variant_get_utf8_from_timestamp_with_timezone                                                     1.00    572.6±2.69µs        ? ?/sec    1.00    571.4±2.80µs        ? ?/sec
variant_get_utf8_from_timestamp_without_timezone                                                  1.00    572.3±2.73µs        ? ?/sec    1.00    571.4±3.08µs        ? ?/sec
variant_get_utf8_from_unshredded_string                                                           1.00    493.0±1.25µs        ? ?/sec    1.01    497.8±1.81µs        ? ?/sec
variant_to_json_dictionary_metadata                                                               1.26      4.0±0.11ms        ? ?/sec    1.00      3.2±0.02ms        ? ?/sec
variant_to_json_list                                                                              1.01     36.8±1.19ms        ? ?/sec    1.00     36.4±0.19ms        ? ?/sec
variant_to_json_object                                                                            1.26      4.0±0.11ms        ? ?/sec    1.00      3.1±0.02ms        ? ?/sec
variant_to_json_primitive                                                                         1.00    733.9±9.13µs        ? ?/sec    1.02    745.6±8.56µs        ? ?/sec
variant_to_json_ree_metadata                                                                      1.24      4.1±0.10ms        ? ?/sec    1.00      3.3±0.02ms        ? ?/sec
variant_to_json_shredded_primitive                                                                1.00    430.0±5.85µs        ? ?/sec    1.02    437.5±5.88µs        ? ?/sec
variant_to_json_wide_object                                                                       1.18    210.9±3.64ms        ? ?/sec    1.00    178.4±0.95ms        ? ?/sec

Per-runner information
variant_kernels — shard 1/1

Node: gk3-benchmark-cluster-nap-1owxhrut-c0a84958-tx7c

Instance: c4a-highmem-16 (12 vCPU / 65 GiB)

uname:

Linux bench-c6405241285-3855-t7rsm 6.12.105+ #1 SMP Sat Sep  5 07:54:11 UTC 2026 aarch64 GNU/Linux

BENCH_COMMAND:

cargo bench --features=arrow,async,test_common,experimental,object_store --bench variant_kernels
CPU Details (lscpu)
Architecture:                            aarch64
CPU op-mode(s):                          64-bit
Byte Order:                              Little Endian
CPU(s):                                  16
On-line CPU(s) list:                     0-15
Vendor ID:                               ARM
Model name:                              Neoverse-V2
Model:                                   1
Thread(s) per core:                      1
Core(s) per cluster:                     16
Socket(s):                               -
Cluster(s):                              1
Stepping:                                r0p1
BogoMIPS:                                2000.00
Flags:                                   fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti
L1d cache:                               1 MiB (16 instances)
L1i cache:                               1 MiB (16 instances)
L2 cache:                                32 MiB (16 instances)
L3 cache:                                80 MiB (1 instance)
NUMA node(s):                            1
NUMA node0 CPU(s):                       0-15
Vulnerability Gather data sampling:      Not affected
Vulnerability Indirect target selection: Not affected
Vulnerability Itlb multihit:             Not affected
Vulnerability L1tf:                      Not affected
Vulnerability Mds:                       Not affected
Vulnerability Meltdown:                  Not affected
Vulnerability Mmio stale data:           Not affected
Vulnerability Reg file data sampling:    Not affected
Vulnerability Retbleed:                  Not affected
Vulnerability Spec rstack overflow:      Not affected
Vulnerability Spec store bypass:         Mitigation; Speculative Store Bypass disabled via prctl
Vulnerability Spectre v1:                Mitigation; __user pointer sanitization
Vulnerability Spectre v2:                Mitigation; CSV2, BHB
Vulnerability Srbds:                     Not affected
Vulnerability Tsa:                       Not affected
Vulnerability Tsx async abort:           Not affected
Vulnerability Vmscape:                   Not affected
Resource Usage

base (merge-base)

Metric Value
Wall time 770.2s
Peak memory 455.1 MiB
Avg memory 309.0 MiB
CPU user 764.4s
CPU sys 0.2s
Peak spill 0 B

branch

Metric Value
Wall time 760.2s
Peak memory 455.2 MiB
Avg memory 311.5 MiB
CPU user 756.6s
CPU sys 0.3s
Peak spill 0 B

File an issue against this benchmark runner

@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.

makes sense to me, benchmark results look good

@Rich-T-kid
Rich-T-kid enabled auto-merge October 26, 2026 04:13
@Rich-T-kid
Rich-T-kid added this pull request to the merge queue Oct 26, 2026
Merged via the queue into apache:main with commit deeb725 Oct 26, 2026
21 checks passed
@Rich-T-kid

Copy link
Copy Markdown
Contributor

thanks @rizzabhdwaj @Jefffrey @sdf-jkl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

parquet-variant parquet-variant* crates performance Speed or memory optimizations

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Variant] Avoid intermediate string allocations in JSON serialization

5 participants