perf(parquet): minor tweaks for iceberg write improvement - #595
Merged
Conversation
zeroshade
approved these changes
Dec 8, 2025
zeroshade
left a comment
Member
There was a problem hiding this comment.
Thanks for this! Looks great with massive benefits. Will merge once the CI finishes (assuming no issues)
13 tasks
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.
Overview
In apache/iceberg-go#643 a benchmark test suite is introduced to measure write performance to iceberg tables. This PR fixes a few hot spots in the parquet writer that improve write performance to iceberg tables across a variety of scenarios. These improvements should be broadly beneficial to anyone using arrow-go to write parquet.
Optimizations
1. Zstd Encoder Pooling
Implemented
sync.Poolfor zstd compression encoders inarrow-go/parquet/compress/zstd.go. Previously, every parquet file write allocated a new 96MB encoder, causing a lot of memory bloat and GC churn. Now encoders are pooled and reused across writes.2. Column Path Caching
Pre-compute column path strings (e.g., "data.field.subfield") in
arrow-go/parquet/schema/column.goduring Column creation instead of rebuilding viastrings.Join()on every access. Eliminates CPU overhead, especially effective for nested schemas.Performance Results
These results are measured using the test suite linked above. No new performance benchmarks are added to arrow-go.
The metrics in the table below indicate 1. the write speed measured in records per second and 2. the volume of memory allocated during the test (not the number of allocations which these changes don't really affect)
Key improvements: