Parquet Writer Optimization - #230
Merged
Merged
Conversation
mchav
approved these changes
Sep 2, 2026
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.
The hot loop in the Parquet Writer repeatedly calls
writeRowwhich does a bunch of IORef bookkeeping. A lot of that book keeping can happen in between subbatches, which are already exposed via the write options. We refactor Encoder.hs, Writer.hs and use some new helper functions in RandomAccess.hs to make the hot loop faster by replacingwriteRowwithwriteRows.Results
Old
benchmarking write 10 GiB dataframe time 23.27 s (23.04 s .. 23.45 s) 1.000 R² (1.000 R² .. 1.000 R²) mean 23.29 s (23.25 s .. 23.32 s) std dev 41.82 ms (19.60 ms .. 57.89 ms) variance introduced by outliers: 19% (moderately inflated)New
benchmarking write 10 GiB dataframe time 18.73 s (18.70 s .. 18.77 s) 1.000 R² (1.000 R² .. 1.000 R²) mean 18.84 s (18.80 s .. 18.91 s) std dev 71.08 ms (10.62 ms .. 92.98 ms) variance introduced by outliers: 19% (moderately inflated)