Repository navigation
bench: add a compressed high-partition writer case (#7080) - #7199
Open
HarshilMital wants to merge 2 commits into
Open
HarshilMital wants to merge 2 commits into
HarshilMital wants to merge 2 commits into
Conversation
Part of apache#7080. What's added: the shuffle_writer_high_partition group (200, 2000 and 8000 hash partitions, end to end) now runs each partition count with Lz4Frame, the default codec, next to the existing CompressionCodec::None rows. The existing IDs are unchanged. Code path: the per-partition write path with compression on. At 8000 partitions each partition gets about ten rows, so every block is tiny and still pays for a fresh LZ4 frame encoder, its header and end mark; the None row at the same partition count isolates that per-block cost. sample_size(10), as the group already uses. Reproduce on the VM (from native/): cargo bench -p datafusion-comet-shuffle --bench shuffle_writer -- 'shuffle_writer_high_partition/.*compression=Lz4Frame' --save-baseline main Results: TODO (VM)
andygrove
reviewed
Oct 25, 2026
andygrove
left a comment
Member
There was a problem hiding this comment.
Thanks for adding the compressed rows. Measuring Lz4Frame next to None at the same partition counts is a useful comparison, and the existing None benchmark IDs are preserved.
The comment above high_partition_group still says "compression is disabled to isolate it", but the group now runs Lz4Frame as well. The paragraph you added right below it describes the Lz4Frame rows, so the two now contradict each other. Could you reword the first one so it says the None rows isolate the per-partition write path and the Lz4Frame rows add the per-block codec cost on top?
…easure The comment above the high-partition group still said compression is disabled to isolate the per-partition write path, which no longer holds now that the group also runs Lz4Frame. Reword it: the None rows isolate that path, and the Lz4Frame rows add the per-block codec cost on top.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Part of #7080.
Rationale for this change
The high-partition group only ran with
CompressionCodec::None, but a wide shuffle runs with LZ4 by default. At high partition counts every block is tiny, so the per-block codec cost (a fresh LZ4 frame encoder, its header and end mark) is spread over very few rows and was never measured.What changes are included in this PR?
Each partition count in
shuffle_writer_high_partition(200, 2000 and 8000 hash partitions, end to end) now also runs withLz4Frame, next to the existingNonerows. The existing IDs are unchanged.sample_size(10), as the group already uses.Results
Machine: 8 vCPU Arm Neoverse-V2 (aarch64), 31 GiB RAM, rustc 1.99.1
Commit:
174bbc6. Median with Criterion's 95% interval.Reproduce from
native/:cargo bench -p datafusion-comet-shuffle --bench shuffle_writer -- 'shuffle_writer_high_partition' --save-baseline maincompression=Nonecompression=Lz4FrameBoth columns come from the same run. The codecs cross over as partitions grow. At 200 partitions (about 400 rows per partition) LZ4 halves the write, most likely because it sends far fewer bytes to the file. By 2000 they are nearly level (LZ4 3% slower), and at 8000 (about 10 rows per partition) LZ4 is 6% slower: the blocks are too small to compress well, so it mostly adds its per-block cost.
How are these changes tested?
This PR only adds benchmark code under
native/shuffle/benches/; no production code changes.cargo fmt --all -- --checkandcargo clippy -p datafusion-comet-shuffle --all-targets -- -D warningspass.cargo bench -p datafusion-comet-shuffle --bench shuffle_writer --no-runbuilds.cargo bench -p datafusion-comet-shuffle --bench shuffle_writer -- --test 'shuffle_writer_high_partition/.*compression=Lz4Frame'.