perf: Change default compression implementation to flate2/zlib-ng
This commit is contained in:
parent
89b9b668ec
commit
6071dc13b0
2 changed files with 7 additions and 10 deletions
11
Cargo.toml
11
Cargo.toml
|
@ -67,24 +67,23 @@ tempdir = "0.3.7"
|
|||
aes-crypto = ["aes", "constant_time_eq", "hmac", "pbkdf2", "sha1", "rand", "zeroize"]
|
||||
chrono = ["chrono/default"]
|
||||
_deflate-any = []
|
||||
_deflate-non-zopfli = ["_deflate-any"]
|
||||
_all-features = [] # Detect when --all-features is used
|
||||
deflate = ["flate2/rust_backend", "_deflate-any"]
|
||||
deflate = ["flate2/rust_backend", "_deflate-non-zopfli"]
|
||||
|
||||
# DEPRECATED: previously enabled `flate2/miniz_oxide` which is equivalent to `flate2/rust_backend`
|
||||
deflate-miniz = ["deflate", "_deflate-any"]
|
||||
deflate-miniz = ["deflate", "_deflate-non-zopfli"]
|
||||
|
||||
deflate-zlib = ["flate2/zlib", "_deflate-any"]
|
||||
deflate-zlib-ng = ["flate2/zlib-ng", "_deflate-any"]
|
||||
deflate-zlib = ["flate2/zlib", "_deflate-non-zopfli"]
|
||||
deflate-zlib-ng = ["flate2/zlib-ng", "_deflate-non-zopfli"]
|
||||
deflate-zopfli = ["zopfli", "_deflate-any"]
|
||||
lzma = ["lzma-rs/stream"]
|
||||
unreserved = []
|
||||
default = [
|
||||
"aes-crypto",
|
||||
"bzip2",
|
||||
"deflate",
|
||||
"deflate64",
|
||||
"deflate-zlib-ng",
|
||||
"deflate-zopfli",
|
||||
"lzma",
|
||||
"time",
|
||||
"zstd",
|
||||
|
|
|
@ -1516,7 +1516,7 @@ impl<W: Write + Seek> GenericZipWriter<W> {
|
|||
}
|
||||
#[cfg(feature = "_deflate-any")]
|
||||
CompressionMethod::Deflated => {
|
||||
let default = if cfg!(feature = "deflate-zopfli") {
|
||||
let default = if cfg!(all(feature = "deflate-zopfli", not(feature = "_deflate-non-zopfli"))) {
|
||||
24
|
||||
} else {
|
||||
Compression::default().level() as i64
|
||||
|
@ -1694,9 +1694,7 @@ impl<W: Write + Seek> GenericZipWriter<W> {
|
|||
|
||||
#[cfg(feature = "_deflate-any")]
|
||||
fn deflate_compression_level_range() -> std::ops::RangeInclusive<i64> {
|
||||
let min = if cfg!(feature = "deflate")
|
||||
|| cfg!(feature = "deflate-zlib")
|
||||
|| cfg!(feature = "deflate-zlib-ng")
|
||||
let min = if cfg!(feature = "_deflate-non-zopfli")
|
||||
{
|
||||
Compression::none().level() as i64
|
||||
} else {
|
||||
|
|
Loading…
Add table
Reference in a new issue