Skip to content

Commit 6f5b12a

Browse files
Byronpascalkuthe
authored andcommitted
feat: a max-performance feature to tune git-repository.
The performance difference is rather drastic at about 2.5x, and definitely worth having if there is no compatibility issue due to shared C dependencies in the same binary. Additionally we setup the makefile to use big object caches to avoid having to decompress the same object too often, accelerating the diffing process about 4x, for a total of 10x performance boost.
1 parent bae80b0 commit 6f5b12a

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

Cargo.toml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,20 @@ include = ["src/**/*", "LICENSE.md", "README.md", "CHANGELOG.md"]
1414
[lib]
1515
test = false
1616

17+
[[test]]
18+
name = "baseline"
19+
path = "tests/baseline.rs"
20+
required-features = ["max-performance"]
21+
22+
[[test]]
23+
name = "baseline-atomic"
24+
path = "tests/baseline_atomic.rs.rs"
25+
required-features = ["max-performance"]
26+
27+
[features]
28+
default = []
29+
max-performance = ["git-repository/max-performance"]
30+
1731
[dependencies]
1832
git-repository = { version = "0.28.0", default-features = false, features = ["max-performance-safe", "blocking-network-client", "blocking-http-transport"] }
1933
serde = { version = "1", features = ["std", "derive"] }

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ CARGO = $(shell command -v cargo)
77
##@ Development
88

99
baseline-atomic: ## run very slow tests that single-step through all commits
10-
RUST_BACKTRACE=1 cargo test --test baseline_atomic --release -- --nocapture
10+
GITOXIDE_PACK_CACHE_MEMORY=1g GITOXIDE_OBJECT_CACHE_MEMORY=3g RUST_BACKTRACE=1 cargo test --test baseline_atomic --release --features max-performance -- --nocapture
1111

1212
test: ## run all tests with cargo
1313
RUST_BACKTRACE=1 cargo test --test crates-index-diff
14-
RUST_BACKTRACE=1 cargo test --test baseline --release
14+
GITOXIDE_PACK_CACHE_MEMORY=1g RUST_BACKTRACE=1 cargo test --test baseline --release --features max-performance
1515

0 commit comments

Comments
 (0)