Skip to content

Commit

Permalink
Merge pull request #87 from sokorototo/main
Browse files Browse the repository at this point in the history
New version with much faster write perfomance and updated ergonomics
  • Loading branch information
zeskeertwee authored May 23, 2024
2 parents a69f263 + 2c6ea66 commit 617b150
Show file tree
Hide file tree
Showing 37 changed files with 807 additions and 982 deletions.
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/target
vach-benchmarks/target

.vscode
.idea
Expand All @@ -7,4 +8,8 @@ perf.data
perf.data.old
workspace.code-workspace
.cargo/config.toml
**.vach

# Test Data
vach/test_data/encrypted/target.vach
vach/test_data/signed/target.vach
vach/test_data/simple/target.vach
144 changes: 59 additions & 85 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 README.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,8 @@ assert_eq!(archive.fetch_mut("d3")?.data.as_slice(), data_3);
- [x] Data encryption.
- [x] Benchmarks.
- [x] Features to turn off (or to turn on) either the `Builder` or the `Loader` modules.
- [x] `Some(examples)` instead of `None`
- [ ] Skynet, (coming _very_ soon).
- [ ] Some proper benchmarking code. (Call for participation)
- [ ] `Some(examples)` directory instead of `None`

> If you appreciate the works of this repo, consider dropping a star. It will be much appreciated; 🌟
7 changes: 6 additions & 1 deletion vach-benchmarks/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ publish = false

[dependencies]
criterion = "0.5.1"
vach = { path = "../vach", features = ["all"] }
vach = { path = "../vach", features = [
"builder",
"archive",
"crypto",
"compression",
] }

[[bench]]
name = "benchmark"
Expand Down
8 changes: 4 additions & 4 deletions vach-benchmarks/benches/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ pub fn criterion_benchmark(c: &mut Criterion) {
let mut b_config = BuilderConfig::default().magic(*MAGIC);
b_config.load_keypair(keypair_bytes).unwrap();

let mut h_config = ArchiveConfig::default().magic(*MAGIC);
h_config.load_public_key(&keypair_bytes[32..]).unwrap();
let mut a_config = ArchiveConfig::default().magic(*MAGIC);
a_config.load_public_key(&keypair_bytes[32..]).unwrap();

/* BUILDER BENCHMARKS */
let mut builder_group = c.benchmark_group("Builder");
Expand Down Expand Up @@ -98,7 +98,7 @@ pub fn criterion_benchmark(c: &mut Criterion) {
// Load data
throughput_group.throughput(Throughput::Elements(3));

let mut archive = Archive::with_config(&mut target, &h_config).unwrap();
let mut archive = Archive::with_config(&mut target, &a_config).unwrap();

throughput_group.bench_function("Archive::fetch(---)", |b| {
// Load data
Expand All @@ -123,7 +123,7 @@ pub fn criterion_benchmark(c: &mut Criterion) {
c.bench_function("Archive::LOAD_NEW", |b| {
// How fast it takes to load a new archive
b.iter(|| {
black_box(Archive::with_config(&mut target, &h_config).unwrap());
black_box(Archive::with_config(&mut target, &a_config).unwrap());
})
});
}
Expand Down
Loading

0 comments on commit 617b150

Please sign in to comment.