Closed AlexTMjugador closed 1 year ago
Cargo deb is also used for one-off deployment, without distribution. Including the --install flag.
This is why it has the --fast flag. Can you re-add support for it? (level() function on the compressor)
Oh, sure, I was not aware of that, I can add that back! Would you prefer this flag to fall back to flate2
, or would it be acceptable to run Zopfli with faster settings, such as fewer iterations or using only static DEFLATE blocks?
It's fine to use zopfli if it can be in the same ballpark as fast zlib.
Thanks! I did some quick benchmarks and noticed that Zopfli with fast settings is still noticeably slower than gzip
/zlib
/flate2
, so I put flate2
back in when fast mode is enabled to avoid performance regressions in that case.
Thank you
As mentioned in https://github.com/kornelski/cargo-deb/issues/100,
cargo-deb
used to use the Zopfli crate for compressing data using the Gzip format, which provides overall smaller results than other general-purpose Gzip encoders that cater to speed more. I think this is a good tradeoff for data meant to be compressed once and distributed or decompressed many times, such as Debian packages.However, the
zopfli
crate API did not support the streaming Gzip encoding thatcargo-deb
moved to. This has changed with its latest v0.8.0 release, bringing it more on par withflate2
, so that's no longer a reason to not use Zopfli.I ran the available test suite and noticed no regressions due to this change.