iemejia opened a new pull request, #3571: URL: https://github.com/apache/parquet-java/pull/3571
Part of #3530 — Apache Parquet Java Performance Improvements ## Summary Eagerly release column buffers during row group flush for correct resource management. Call `pageWriter.close()` after each column in `flushToFileWriter()` instead of holding all buffers until the entire flush completes. Add `writeAllToAndRelease()` to `ConcatenatingByteBufferCollector` for progressive slab-by-slab memory release during write. Make `close()` idempotent (safe after eager release or double-close). ### Changes - Call `pageWriter.close()` after each column in `flushToFileWriter()` - Add `writeAllToAndRelease()` to `ConcatenatingByteBufferCollector` for progressive slab-by-slab memory release during write - Make `close()` idempotent (safe to call after eager release or double-close) - Add `RowGroupFlushBenchmark` (20-column wide schema, `PeakTrackingAllocator`) and `BlackHoleOutputFile` for measuring flush performance and peak memory - Add tests for eager release, double-close safety, and output equivalence ## Benchmark results **Environment**: JDK 25.0.3 (Temurin), OpenJDK 64-Bit Server VM, JMH 1.37, Linux x86_64. `RowGroupFlushBenchmark` (100K rows, 20 BINARY columns, 200 bytes each, UNCOMPRESSED): | Row Group Size | Avg Time (ms) | Peak Allocator (MB) | |---|---:|---:| | 8 MB | 305.5 +/- 14.0 | 9.4 | | 64 MB | 313.8 +/- 11.3 | 66.0 | Peak memory is byte-for-byte identical with and without this change. The peak is reached during the write phase (as pages are compressed), not during flush. This is correct resource management that makes buffers GC-eligible sooner, but should not be claimed as a memory optimization. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
