Skip to content

perf: reuse Arrow IPC compression context across shuffle blocks - #5038

Open
peterxcli wants to merge 1 commit into
apache:mainfrom
peterxcli:perf/reuse-compression-context-across-shuffle-blocks
Open

perf: reuse Arrow IPC compression context across shuffle blocks#5038
peterxcli wants to merge 1 commit into
apache:mainfrom
peterxcli:perf/reuse-compression-context-across-shuffle-blocks

Conversation

@peterxcli

Copy link
Copy Markdown
Member

Which issue does this PR close?

Closes #5008.

Rationale for this change

Avoid recreating Arrow IPC compression state for every shuffle block.

What changes are included in this PR?

Reuse one CompressionContext per buffered partition writer and across batches in the JVM row conversion path. Update benchmarks and callers accordingly.

How are these changes tested?

Existing shuffle IPC round-trip, buffered writer, and shuffle scan tests pass. The shuffle writer benchmark also compiles successfully.

@andygrove

Copy link
Copy Markdown
Member

Thanks @peterxcli. Can you share any benchmark results?

@peterxcli

peterxcli commented Jul 26, 2026

Copy link
Copy Markdown
Member Author

@andygrove this would take effect only after #4888 is merged.
and the reason is:


with arrow 58.4:

Production path Baseline / patch blocks FlatBuffer allocations per block FlatBuffer bytes per block Context allocations
JVM sort → row.rs 2,688 / 2,441 11 / 11 4,136 / 4,136 0 / 0
Native → BufBatchWriter 5,857 / 4,298 11 / 11 4,136 / 4,136 0 / 0

with arrow 59.1:

1,000 blocks Fresh context Reused context
Allocation calls 212,000 201,011
Requested bytes 8,508,496,000 8,504,364,136

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

perf: reuse Arrow IPC CompressionContext across shuffle blocks instead of per-batch allocation

2 participants