mirror of
https://github.com/apache/arrow.git
synced 2026-10-28 16:47:19 +08:00
### Rationale for this change `GZipCodec::Init()` initializes compressor state and then immediately initializes decompressor state, which tears the compressor state down again. Compressor state is fairly expensive to initialize (the `deflateInit2` call allocates ~256KiB), so this is rather wasteful. A caller that wants to compress has to do it twice (because decompressor initialization throws it away), and a caller that only wants to decompress still has to do the compressor setup. Whatever the caller wants to do with the GZipCodec, this is pure waste. ### What changes are included in this PR? `GZipCodec::Init()` now validates the compression level and window size without allocating codec state. Since all the compression and decompression methods have to check the mode anyway before doing any work, this is safe. ### Are these changes tested? Largely relying on existing test coverage; the interesting part is that `InitCompressor()` validated the compression level internally, so this check has to be extracted. Split the unit test that covered this into a few separate cases to make it clearer. ### Are there any user-facing changes? No. ### Was AI used for this PR? Yes, both to find the issue and to fix it (Codex). **PR code and description written by:** - [X] Human (PR desc) - [X] AI (code) **Reviewed before submission by:** - [X] Human - [ ] AI - [ ] Not reviewed # * GitHub Issue: #51308 Authored-by: Lorenz Hübschle <lorenz@firebolt.io> Signed-off-by: Antoine Pitrou <antoine@python.org>
Apache Arrow C++
This directory contains the code and build system for the Arrow C++ libraries, as well as for the C++ libraries for Apache Parquet.
Installation
See https://arrow.apache.org/install/ for the latest instructions on how to install pre-compiled binary versions of the library.
Source Builds and Development
Please refer to our latest C++ Development Documentation.