Skip to content

Commit b7d47c2

Browse files
committed
Add new feature zlib-rs
Also bump flate2 to 1.1.0 to make sure it support zlib-rs Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
1 parent d0ef276 commit b7d47c2

File tree

4 files changed

+33
-11
lines changed

4 files changed

+33
-11
lines changed

Cargo.lock

Lines changed: 20 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gix-archive/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ gix-object = { version = "^0.47.0", path = "../gix-object" }
3232
gix-path = { version = "^0.10.14", path = "../gix-path", optional = true }
3333
gix-date = { version = "^0.9.3", path = "../gix-date" }
3434

35-
flate2 = { version = "1.0.33", optional = true }
35+
flate2 = { version = "1.0.33", optional = true, default-features = false }
3636
zip = { version = "2.1.0", optional = true, default-features = false, features = ["deflate"] }
3737
jiff = { version = "0.2.0", default-features = false, features = ["std"] }
3838

gix-features/Cargo.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@ tracing-detail = ["gix-trace/tracing-detail"]
4646
## As caches are likely to be used and instantiated per thread, more memory will be used on top of the costs for threads.
4747
## The `threading` module will contain thread-safe primitives for shared ownership and mutation, otherwise these will be their single threaded counterparts.
4848
## This way, single-threaded applications don't have to pay for threaded primitives.
49-
parallel = ["dep:crossbeam-channel",
50-
"dep:parking_lot"]
49+
parallel = ["dep:crossbeam-channel", "dep:parking_lot"]
5150
## If enabled, OnceCell will be made available for interior mutability either in sync or unsync forms.
5251
once_cell = ["dep:once_cell"]
5352
## Makes facilities of the `walkdir` crate partially available.
@@ -67,6 +66,8 @@ crc32 = ["dep:crc32fast"]
6766
zlib = ["dep:flate2", "flate2?/rust_backend", "dep:thiserror"]
6867
## Use the C-based zlib-ng backend, which can compress and decompress significantly faster.
6968
zlib-ng = ["zlib", "flate2?/zlib-ng"]
69+
## Use the rust-based zlib backend, which can compress and decompress significantly faster and is on par with zlib-ng or even faster.
70+
zlib-rs = ["zlib", "flate2?/zlib-rs"]
7071
## Use zlib-ng via its zlib-compat API. Useful if you already need zlib for C
7172
## code elsewhere in your dependencies. Otherwise, use zlib-ng.
7273
zlib-ng-compat = ["zlib", "flate2?/zlib-ng-compat"]
@@ -145,7 +146,7 @@ bytesize = { version = "1.0.1", optional = true }
145146
bytes = { version = "1.0.0", optional = true }
146147

147148
# zlib module
148-
flate2 = { version = "1.0.33", optional = true, default-features = false }
149+
flate2 = { version = "1.1.0", optional = true, default-features = false }
149150
thiserror = { version = "2.0.0", optional = true }
150151

151152
once_cell = { version = "1.13.0", optional = true }

gix/Cargo.toml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -252,9 +252,9 @@ pack-cache-lru-static = ["gix-pack/pack-cache-lru-static"]
252252
## Provide a hash-map based LRU cache whose eviction is based a memory cap calculated from object data.
253253
pack-cache-lru-dynamic = ["gix-pack/pack-cache-lru-dynamic"]
254254

255-
## Activate other features that maximize performance, like usage of threads, `zlib-ng` and access to caching in object databases.
255+
## Activate other features that maximize performance, like usage of threads, `zlib-rs` and access to caching in object databases.
256256
## Note that some platforms might suffer from compile failures, which is when `max-performance-safe` should be used.
257-
max-performance = ["max-performance-safe", "zlib-ng", "fast-sha1"]
257+
max-performance = ["max-performance-safe", "zlib-rs", "fast-sha1"]
258258

259259
## If enabled, use assembly versions of sha1 on supported platforms.
260260
## This might cause compile failures as well which is why it can be turned off separately.
@@ -264,6 +264,9 @@ fast-sha1 = ["gix-features/fast-sha1"]
264264
## Note that this will cause duplicate symbol errors if the application also depends on `zlib` - use `zlib-ng-compat` in that case.
265265
zlib-ng = ["gix-features/zlib-ng"]
266266

267+
## Use the rust-based zlib backend, which can compress and decompress significantly faster and is on par with zlib-ng or even faster.
268+
zlib-rs = ["gix-features/zlib-rs"]
269+
267270
## Use zlib-ng via its zlib-compat API. Useful if you already need zlib for C
268271
## code elsewhere in your dependencies. Otherwise, use `zlib-ng`.
269272
zlib-ng-compat = ["gix-features/zlib-ng-compat"]
@@ -406,7 +409,9 @@ document-features = { version = "0.2.0", optional = true }
406409

407410
[dev-dependencies]
408411
# For additional features that aren't enabled by default due to MSRV
409-
gix = { path = ".", default-features = false, features = ["need-more-recent-msrv"] }
412+
gix = { path = ".", default-features = false, features = [
413+
"need-more-recent-msrv",
414+
] }
410415
pretty_assertions = "1.4.0"
411416
gix-testtools = { path = "../tests/tools" }
412417
is_ci = "1.1.1"

0 commit comments

Comments
 (0)