mirror of
https://github.com/martinvonz/jj.git
synced 2025-05-05 15:32:49 +00:00
cargo: use gix/zlib-rs
feature
This uses `zlib-rs`, a native Rust library that is comparable in performance to `zlib-ng`. Since there’s no complicated C build and gitoxide only has one hashing backend now, this lets us drop our `packaging` feature without adding any awkward build requirements. `zlib-rs` is generally faster at decompression than `zlib-ng`, and faster at compression on levels 6 and 9; see <https://trifectatech.org/blog/zlib-rs-is-faster-than-c/> for details. I couldn’t get reliable‐looking benchmark results out of my temperamental laptop; `hyperfine` seemed to think that some random `jj` workloads I tested might be slightly slower than with `zlib-ng`, but it wasn’t unambiguously distinguishable from noise, so I’d like to see measurements from others. It’s certainly a lot faster than the previous default, and I think it’s likely that `zlib-rs` will continue to get faster and that it’s more than worth avoiding the headaches of a native library with a CMake build dependency. (Though on the other hand, if distributions move in the direction of shipping `zlib-ng` by default, maybe there will be more motivation to make `libz-ng-sys` support system libraries.)
This commit is contained in:
parent
1716b7f8d3
commit
e5478bbf7b
2
.github/workflows/binaries.yml
vendored
2
.github/workflows/binaries.yml
vendored
@ -56,7 +56,7 @@ jobs:
|
|||||||
target: ${{ matrix.target }}
|
target: ${{ matrix.target }}
|
||||||
- name: Build release binary
|
- name: Build release binary
|
||||||
shell: bash
|
shell: bash
|
||||||
run: cargo build --target ${{ matrix.target }} --verbose --release --features packaging,vendored-openssl
|
run: cargo build --target ${{ matrix.target }} --verbose --release --features vendored-openssl
|
||||||
|
|
||||||
- name: Set up artifact directory
|
- name: Set up artifact directory
|
||||||
shell: bash
|
shell: bash
|
||||||
|
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
@ -52,7 +52,7 @@ jobs:
|
|||||||
target: ${{ matrix.target }}
|
target: ${{ matrix.target }}
|
||||||
- name: Build release binary
|
- name: Build release binary
|
||||||
shell: bash
|
shell: bash
|
||||||
run: cargo build --target ${{ matrix.target }} --verbose --release --features packaging,vendored-openssl
|
run: cargo build --target ${{ matrix.target }} --verbose --release --features vendored-openssl
|
||||||
- name: Build archive
|
- name: Build archive
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
|
@ -31,6 +31,13 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|||||||
|
|
||||||
### Fixed bugs
|
### Fixed bugs
|
||||||
|
|
||||||
|
### Packaging changes
|
||||||
|
|
||||||
|
* Jujutsu now uses
|
||||||
|
[`zlib-rs`](https://github.com/trifectatechfoundation/zlib-rs), a
|
||||||
|
fast compression library written in Rust. Packagers should remove any
|
||||||
|
dependency on CMake and drop the `packaging` Cargo feature.
|
||||||
|
|
||||||
## [0.28.2] - 2025-04-07
|
## [0.28.2] - 2025-04-07
|
||||||
|
|
||||||
### Fixed bugs
|
### Fixed bugs
|
||||||
|
26
Cargo.lock
generated
26
Cargo.lock
generated
@ -465,15 +465,6 @@ version = "0.6.2"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "cbd0f76e066e64fdc5631e3bb46381254deab9ef1158292f27c8c57e3bf3fe59"
|
checksum = "cbd0f76e066e64fdc5631e3bb46381254deab9ef1158292f27c8c57e3bf3fe59"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "cmake"
|
|
||||||
version = "0.1.54"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "e7caa3f9de89ddbe2c607f4101924c5abec803763ae9534e4f4d7d8f84aa81f0"
|
|
||||||
dependencies = [
|
|
||||||
"cc",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "colorchoice"
|
name = "colorchoice"
|
||||||
version = "1.0.3"
|
version = "1.0.3"
|
||||||
@ -898,7 +889,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "7ced92e76e966ca2fd84c8f7aa01a4aea65b0eb6648d72f7c8f3e2764a67fece"
|
checksum = "7ced92e76e966ca2fd84c8f7aa01a4aea65b0eb6648d72f7c8f3e2764a67fece"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"crc32fast",
|
"crc32fast",
|
||||||
"libz-ng-sys",
|
"libz-rs-sys",
|
||||||
"miniz_oxide",
|
"miniz_oxide",
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -2495,13 +2486,12 @@ dependencies = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libz-ng-sys"
|
name = "libz-rs-sys"
|
||||||
version = "1.1.22"
|
version = "0.5.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "a7118c2c2a3c7b6edc279a8b19507672b9c4d716f95e671172dfa4e23f9fd824"
|
checksum = "6489ca9bd760fe9642d7644e827b0c9add07df89857b0416ee15c1cc1a3b8c5a"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cmake",
|
"zlib-rs",
|
||||||
"libc",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -4941,3 +4931,9 @@ dependencies = [
|
|||||||
"quote",
|
"quote",
|
||||||
"syn 2.0.100",
|
"syn 2.0.100",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "zlib-rs"
|
||||||
|
version = "0.5.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "868b928d7949e09af2f6086dfc1e01936064cc7a819253bce650d4e2a2d63ba8"
|
||||||
|
@ -59,6 +59,7 @@ gix = { version = "0.71.0", default-features = false, features = [
|
|||||||
"blob-diff",
|
"blob-diff",
|
||||||
"index",
|
"index",
|
||||||
"max-performance-safe",
|
"max-performance-safe",
|
||||||
|
"zlib-rs",
|
||||||
] }
|
] }
|
||||||
glob = "0.3.2"
|
glob = "0.3.2"
|
||||||
hashbrown = { version = "0.15.2", default-features = false, features = ["inline-more"] }
|
hashbrown = { version = "0.15.2", default-features = false, features = ["inline-more"] }
|
||||||
|
@ -113,8 +113,6 @@ default = ["watchman", "git", "git2"]
|
|||||||
bench = ["dep:criterion"]
|
bench = ["dep:criterion"]
|
||||||
git = ["jj-lib/git", "dep:gix"]
|
git = ["jj-lib/git", "dep:gix"]
|
||||||
git2 = ["git", "jj-lib/git2", "dep:git2"]
|
git2 = ["git", "jj-lib/git2", "dep:git2"]
|
||||||
gix-max-performance = ["jj-lib/gix-max-performance"]
|
|
||||||
packaging = ["gix-max-performance"]
|
|
||||||
test-fakes = ["jj-lib/testing"]
|
test-fakes = ["jj-lib/testing"]
|
||||||
vendored-openssl = ["git2/vendored-openssl", "jj-lib/vendored-openssl"]
|
vendored-openssl = ["git2/vendored-openssl", "jj-lib/vendored-openssl"]
|
||||||
watchman = ["jj-lib/watchman"]
|
watchman = ["jj-lib/watchman"]
|
||||||
|
@ -93,7 +93,6 @@ allow = [
|
|||||||
"Apache-2.0 WITH LLVM-exception",
|
"Apache-2.0 WITH LLVM-exception",
|
||||||
"Apache-2.0",
|
"Apache-2.0",
|
||||||
"BSD-3-Clause",
|
"BSD-3-Clause",
|
||||||
"ISC",
|
|
||||||
"MIT",
|
"MIT",
|
||||||
"MPL-2.0",
|
"MPL-2.0",
|
||||||
"Unicode-3.0",
|
"Unicode-3.0",
|
||||||
|
@ -64,10 +64,6 @@
|
|||||||
[
|
[
|
||||||
gzip
|
gzip
|
||||||
pkg-config
|
pkg-config
|
||||||
|
|
||||||
# for libz-ng-sys (zlib-ng)
|
|
||||||
# TODO: switch to the packaged zlib-ng and drop this dependency
|
|
||||||
cmake
|
|
||||||
]
|
]
|
||||||
++ lib.optionals stdenv.isLinux [
|
++ lib.optionals stdenv.isLinux [
|
||||||
mold-wrapped
|
mold-wrapped
|
||||||
@ -109,7 +105,6 @@
|
|||||||
pname = "jujutsu";
|
pname = "jujutsu";
|
||||||
version = "unstable-${self.shortRev or "dirty"}";
|
version = "unstable-${self.shortRev or "dirty"}";
|
||||||
|
|
||||||
buildFeatures = ["packaging"];
|
|
||||||
cargoBuildFlags = ["--bin" "jj"]; # don't build and install the fake editors
|
cargoBuildFlags = ["--bin" "jj"]; # don't build and install the fake editors
|
||||||
useNextest = true;
|
useNextest = true;
|
||||||
cargoTestFlags = ["--profile" "ci"];
|
cargoTestFlags = ["--profile" "ci"];
|
||||||
|
@ -97,12 +97,6 @@ tokio = { workspace = true, features = ["full"] }
|
|||||||
default = ["git", "git2"]
|
default = ["git", "git2"]
|
||||||
git = ["dep:gix"]
|
git = ["dep:gix"]
|
||||||
git2 = ["git", "dep:git2"]
|
git2 = ["git", "dep:git2"]
|
||||||
gix-max-performance = [
|
|
||||||
# Requires `cmake` as a build dependency.
|
|
||||||
# Note that this feature is different from `gix/max-performance-safe`.
|
|
||||||
# See: https://docs.rs/gix/latest/gix/#performance
|
|
||||||
"gix/max-performance",
|
|
||||||
]
|
|
||||||
vendored-openssl = ["git2/vendored-openssl"]
|
vendored-openssl = ["git2/vendored-openssl"]
|
||||||
watchman = ["dep:tokio", "dep:watchman_client"]
|
watchman = ["dep:tokio", "dep:watchman_client"]
|
||||||
testing = ["git"]
|
testing = ["git"]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user