Skip to content

Threshold Compressibility Testing

Peter Hyman edited this page Mar 7, 2021 · 1 revision

Threshold Testing

lrzip-next will employ threshold testing by default.
lrzip-next -T will disable threshold testing
lrzip-next -T[1-99] will test for a block T% of the original to be passed to the compressor.

Threshold compatibility testing was introduced way back in the 0.20 series. However, it did not seem to work as intended. It was designed to prevent an incompressible block of data from being passed to a back-end compressor. This was both to save time by avoiding any compression attempt, but also (in the early days) to prevent LZMA from failing. By default, any byte savings, as determined by lz4_compresses() will permit backend compression to continue.

In addition, a limit parameter option could also be passed as an option that would permit a block that is T% of the original to be passed to be backend compressor. This, for some reason never worked!

Method

lrzip-next tests a block in successively larger chunks to see if the lz4 compressor can return a block smaller than the original. If Threshold limiting is active, then it would be T% of the original block or less. The original block test size is 10MB and increases by that amount each loop until there is nothing more to test

*Note. If using the -T commandline option, do not use a space if specifying the optional percent parameter. Use -T##. The long --threshold option can be used as normal, --threshold ##. **Note. Threshold testing only is performed on bzip, lzma, and zpaq compression methods.