Skip to content

Commit

Permalink
cargo: enable zlib-ng and fast sha1 in gix
Browse files Browse the repository at this point in the history
I noticed miniz_oxide appears in perf samples. While miniz_oxide is safer, I
think zlib-ng is pretty reliable.

https://docs.rs/gix/latest/gix/#performance

libz-ng-sys is downgraded to 1.1.16 due to the Windows linking issue. The
benchmark result is obtained with libz-ng-sys 1.1.20.

rust-lang/libz-sys#225

```
% hyperfine --sort command --warmup 3 --runs 10 -L bin jj-0,jj-1 \
  'target/release-with-debug/{bin} --ignore-working-copy log README.md'
Benchmark 1: target/release-with-debug/jj-0 ..
  Time (mean ± σ):     256.6 ms ±   4.3 ms    [User: 214.1 ms, System: 38.6 ms]
  Range (min … max):   245.4 ms … 261.2 ms    10 runs

Benchmark 2: target/release-with-debug/jj-1 ..
  Time (mean ± σ):     223.0 ms ±   4.2 ms    [User: 174.7 ms, System: 44.4 ms]
  Range (min … max):   212.4 ms … 225.8 ms    10 runs
```
  • Loading branch information
yuja committed Dec 6, 2024
1 parent c0ce880 commit f58145b
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 2 deletions.
42 changes: 42 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ gix = { version = "0.68.0", default-features = false, features = [
"attributes",
"blob-diff",
"index",
"max-performance-safe",
"max-performance",
] }
glob = "0.3.1"
hashbrown = { version = "0.15.2", default-features = false, features = ["inline-more"] }
Expand Down
10 changes: 9 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,12 @@
makeWrapper
pkg-config

# for libz-ng-sys (zlib-ng)
# TODO: switch to the packaged zlib-ng and drop this dependency
cmake

# for signing tests
gnupg
gnupg
openssh
] ++ linuxNativeDeps;
buildInputs = with pkgs; [
Expand Down Expand Up @@ -185,6 +189,10 @@
# In case you need to run `cargo run --bin gen-protos`
protobuf

# for libz-ng-sys (zlib-ng)
# TODO: switch to the packaged zlib-ng and drop this dependency
cmake

# To run the signing tests
gnupg
openssh
Expand Down

0 comments on commit f58145b

Please sign in to comment.