Add benches

This commit is contained in:
Cyryl Płotnicki 2021-05-16 20:24:11 +01:00
parent 20373325a9
commit 2d3cfe358e
5 changed files with 233 additions and 566 deletions

786
Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -7,7 +7,6 @@ license = "AGPL-3.0"
description = "modern and simple, yet efficient backup solution"
[dependencies]
cacache = "8"
anyhow = "1.0"
atomicwrites = "0.3"
base64 = "0.13"
@ -32,15 +31,20 @@ uuid = { version = "0.8", features = ["v4"] }
walkdir = "2.3"
[dev-dependencies]
criterion = "0.3"
pretty_assertions = "0.7"
proptest = "1"
two-rusty-forks = "0.4.0"
pretty_assertions = "0.7"
[dev-dependencies.cargo-husky]
version = "1"
default-features = false
features = ["run-for-all", "prepush-hook", "run-cargo-check", "run-cargo-test", "run-cargo-clippy", "run-cargo-fmt"]
[[bench]]
name = "bench"
harness = false
[profile.release]
debug = 1

View file

@ -10,7 +10,7 @@ Contributions are welcome :)
- [x] simple deduplication of file data - don't store the same exact file data twice
- [ ] advanced deduplication - store files that only changed slightly more efficiently
- [x] survive index corruption
- [ ] resilient towards interrupting the backup (create index checkpoints etc)
- fast
- using max bandwidth
- use max cpu

1
benches/bench.rs Normal file
View file

@ -0,0 +1 @@

View file

@ -72,7 +72,7 @@ impl Index {
Some(parent) => Ok(fs::create_dir_all(parent)),
}??;
let serialised = serde_json::to_string(&self)?;
let serialised = serde_json::to_string_pretty(&self)?;
let bytes = serialised.as_bytes();
let encoded = error_correcting_encoder::encode(bytes)?;