G
YouTube TikTok Games
Skip to content

bench(parquet): add level encoding and nested writer cases - #12213

Merged
Rich-T-kid merged 1 commit into
apache:mainfrom
JonSnow1807:bench-level-encoding-12194
Nov 12, 2026
Merged

Rich-T-kid merged 1 commit into
apache:mainfrom
JonSnow1807:bench-level-encoding-12194

Conversation

@JonSnow1807

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Rationale for this change

Adds benchmarks for definition/repetition level encoding and more nested-column writer cases, so the change proposed in #12194 can be measured against main.

What changes are included in this PR?

  • parquet/benches/level_encoding.rs: level encoding benchmarks (mixed, uniform and fragmented levels).
  • parquet/benches/arrow_writer.rs: two nested cases, list_short (short lists with nulls) and map.

Are these changes tested?

Benchmarks only; they build with cargo bench on main.

Are there any user-facing changes?

No.

Code drafted by both human and AI, and reviewed by human.

Add a level_encoding bench that feeds LevelEncoder::put_with_observer one
mini-batch at a time with a counting and histogram observer, over random,
alternating, run-length, sparse and list-shaped levels. Add list_short
(List<Int32> with 0..=9 elements and nulls) and map cases to arrow_writer.
@boring-cyborg boring-cyborg Bot added the parquet Changes to the parquet crate label Nov 12, 2026
@Rich-T-kid

Copy link
Copy Markdown
Contributor

run benchmark level_encoding

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark starting (GKE) | trigger

Target: level_encoding

Sharding factor: 1 (1 workers).

Comparing bench-level-encoding-12194 (045b62d) to b2b7d47 (merge-base) diff

Run configuration
run benchmark level_encoding
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: level_encoding

Comparing bench-level-encoding-12194 (045b62d) to b2b7d47 (merge-base) diff

Run configuration
run benchmark level_encoding
shards: 1

Baseline build unavailable for shard(s) 1; changed-only measurements for those workers.

Details
group                                          changed
-----                                          -------
level_encoding/alternating/max1                1.00   186.7±15.94µs 334.8 MElem/sec
level_encoding/list_0_4_25pct_null/def_max3    1.00   320.2±14.70µs 195.2 MElem/sec
level_encoding/list_0_4_25pct_null/rep_max1    1.00   325.1±13.62µs 192.3 MElem/sec
level_encoding/list_0_9/def_max3               1.00    220.7±6.80µs 283.2 MElem/sec
level_encoding/list_0_9/rep_max1               1.00   265.2±12.41µs 235.6 MElem/sec
level_encoding/list_list/def_max5              1.00   306.6±14.58µs 203.9 MElem/sec
level_encoding/list_list/rep_max2              1.00   297.0±16.44µs 210.4 MElem/sec
level_encoding/long_runs/max3                  1.00     31.0±0.06µs 2017.0 MElem/sec
level_encoding/mixed_runs/max3                 1.00     78.1±1.50µs 800.7 MElem/sec
level_encoding/nullable_25pct/max1             1.00   294.2±14.82µs 212.4 MElem/sec
level_encoding/random/max1                     1.00    347.3±9.22µs 180.0 MElem/sec
level_encoding/random/max3                     1.00   249.2±10.50µs 250.8 MElem/sec
level_encoding/random/max7                     1.00    200.9±4.64µs 311.1 MElem/sec
level_encoding/sparse_99pct_null/max1          1.00     57.5±1.02µs 1087.0 MElem/sec
level_encoding/uniform/max1                    1.00     30.6±0.03µs 2044.0 MElem/sec

Per-runner information
level_encoding — shard 1/1

Node: gk3-benchmark-cluster-nap-gneavwlm-88b578e7-dmr5

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

uname:

Linux bench-c6830964634-4841-g5nzk 6.12.105+ #1 SMP Sat Sep 19 07:55:25 UTC 2026 aarch64 GNU/Linux

BENCH_COMMAND:

cargo bench --features=arrow,async,test_common,experimental,object_store --bench level_encoding
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

branch

Metric Value
Wall time 160.0s
Peak memory 12.4 MiB
Avg memory 11.2 MiB
CPU user 155.9s
CPU sys 0.0s
Peak spill 0 B

File an issue against this benchmark runner

@Rich-T-kid
Rich-T-kid self-requested a review November 12, 2026 17:36

@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 @JonSnow1807 LGTM left a comment

// What the column writer does per mini-batch: count values at max level
// and update the page's level histogram
group.bench_function(&name, |b| {
let mut encoder = LevelEncoder::v2_streaming(max_level);

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.

is there any specific reason why were using v2_streaming here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No particular reason beyond the encoding work being the same: the column writer uses v1_streaming for PARQUET_1_0 (the default) and v2_streaming for PARQUET_2_0, and both feed the same RleEncoder through put_with_observer. The only difference is the 4-byte length prefix v1 writes when a page is flushed. Happy to switch to v1_streaming to match the default if you prefer.

@Rich-T-kid
Rich-T-kid added this pull request to the merge queue Nov 12, 2026
Merged via the queue into apache:main with commit cd91f89 Nov 12, 2026
20 checks passed
@Jefffrey Jefffrey added the development-process Internal changes; PRs with this label are excluded from changelog label Nov 13, 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.

4 participants