From 33bd902271c17355689b6410c87268abae993977 Mon Sep 17 00:00:00 2001 From: Sam Reis Date: Tue, 22 Sep 2026 22:26:00 +0200 Subject: [PATCH] perf(gix-hash): upgrade sha1dc to 0.1.2 sha1dc 0.1.2 speeds up the collision check: recompression now uses the SHA-1 hardware instructions where available, and the filter for known disturbance vectors got cheaper. The minimum version is raised so dependents of `gix-hash` pick it up too. Performance: On an Apple M4 (4P/6E), against a bare clone of `git/git`: 421,363 objects, 305 MiB pack. Built from the tree of #3008 with the `max-pure` feature set and one target directory, with only the SHA-1 backend toggled; fastest of 5 rounds, rotating between builds each round. | operation | `sha1-checked` | `sha1dc` 0.1.1 | `sha1dc` 0.1.2 | vs 0.1.1 | |---|---:|---:|---:|---:| | `gix free pack verify` (1 thread) | 12.85s | 6.11s | 5.65s | **1.08x** | | `gix free pack index create` (1 thread) | 14.69s | 7.77s | 7.30s | **1.06x** | | `gix free pack verify` (all cores) | 2.28s | 1.06s | 1.03s | 1.03x | | `gix free pack index create` (all cores) | 4.28s | 2.80s | 2.69s | 1.04x | The all-cores runs were noisy on this machine, and their medians are on par between 0.1.1 and 0.1.2; the single-threaded gains are consistent across rounds. Co-Authored-By: Claude Opus 5.5 (1M context) --- Cargo.lock | 4 ++-- gix-hash/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d02521f3f1f..50bba1d9003 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4918,9 +4918,9 @@ dependencies = [ [[package]] name = "sha1dc" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a74716892dfa2159e824baf5395d44ec2923711a9b1c14c2eda81749a560a505" +checksum = "1fdf1713fb0547b120571e5f7b37dc2650dc03d2abf46a18928f54372000947f" [[package]] name = "sha2" diff --git a/gix-hash/Cargo.toml b/gix-hash/Cargo.toml index 18af8046ada..e45586ac459 100644 --- a/gix-hash/Cargo.toml +++ b/gix-hash/Cargo.toml @@ -33,7 +33,7 @@ gix-error = { version = "^0.3.0", path = "../gix-error" } bstr = { version = "1.12.0", optional = true, default-features = false, features = ["alloc"] } faster-hex = { version = "0.10.0", default-features = false, features = ["std"] } serde = { version = "1.0.114", optional = true, default-features = false, features = ["derive"] } -sha1dc = { version = "0.1.1", optional = true, default-features = false, features = ["std"] } +sha1dc = { version = "0.1.2", optional = true, default-features = false, features = ["std"] } sha2 = { version = "0.11.0", optional = true, default-features = false } document-features = { version = "0.2.0", optional = true }