nuno-faria opened a new issue, #10560:
URL: https://github.com/apache/arrow-rs/issues/10560

   ### Is your feature request related to a problem or challenge?
   
   The current minimum ZSTD level allowed is 1, although the specification 
supports negative levels that tradeoff storage size for speed: 
https://facebook.github.io/zstd/zstd_manual.html
   >The library also offers negative compression levels, which extend the range 
of speed vs. ratio preferences. The lower the level, the faster the speed (at 
the cost of compression).
   
   The underlying `zstd` crate also supports negative levels.
   
   The minimum supported level by `libzstd` appears to be `-131072`:
   
   ```c++
   // 
https://github.com/facebook/zstd/blob/dev/lib/compress/zstd_compress.c#L8201
   int ZSTD_minCLevel(void) { return (int)-ZSTD_TARGETLENGTH_MAX; }
   
   // 
https://github.com/facebook/zstd/blob/82d322c4973d9e2968d94047a40892bc6d9a9bdf/lib/zstd.h#L1277
   #define ZSTD_TARGETLENGTH_MAX    ZSTD_BLOCKSIZE_MAX
   
   // 
https://github.com/facebook/zstd/blob/82d322c4973d9e2968d94047a40892bc6d9a9bdf/lib/zstd.h#L147
   #define ZSTD_BLOCKSIZELOG_MAX  17
   #define ZSTD_BLOCKSIZE_MAX     (1<<ZSTD_BLOCKSIZELOG_MAX)
   
   // ZSTD_minCLevel() = - (1 << 17) = -131072
   ```
   
   Supporting this is pretty straightforward, the compression level is even an 
`i32` already, but I want to know if there is a reason why this is not 
supported before opening a PR.
   
   ### Describe the solution you'd like
   
   Support negative levels.
   
   ### Describe alternatives you've considered
   
   _No response_
   
   ### Additional context
   
   _No response_


-- 
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]

Reply via email to