Repository navigation
bench(parquet): add level encoding and nested writer cases - #12213
Conversation
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.
|
run benchmark level_encoding |
|
🤖 Benchmark starting (GKE) | trigger Target: level_encoding Sharding factor: 1 (1 workers). Comparing bench-level-encoding-12194 (045b62d) to b2b7d47 (merge-base) diff Run configurationrun benchmark level_encoding
shards: 1
Results will be posted when all workers finish. File an issue against this benchmark runner |
|
🤖 Benchmark completed (GKE) | trigger Target: level_encoding Comparing bench-level-encoding-12194 (045b62d) to b2b7d47 (merge-base) diff Run configurationrun benchmark level_encoding
shards: 1
Baseline build unavailable for shard(s) 1; changed-only measurements for those workers. DetailsPer-runner informationlevel_encoding — shard 1/1Node: gk3-benchmark-cluster-nap-gneavwlm-88b578e7-dmr5 Instance: c4a-highmem-16 (12 vCPU / 65 GiB) uname: BENCH_COMMAND: cargo bench --features=arrow,async,test_common,experimental,object_store --bench level_encodingCPU Details (lscpu)Resource Usagebranch
File an issue against this benchmark runner |
Rich-T-kid
left a comment
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
is there any specific reason why were using v2_streaming here?
There was a problem hiding this comment.
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.
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) andmap.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.