feat(nbstore): add sqlite implementation (#8811)

This commit is contained in:
forehalo
2024-12-13 06:13:05 +00:00
parent 932e1da7f3
commit 8c24f2b906
66 changed files with 2932 additions and 397 deletions
+5
View File
@@ -10,3 +10,8 @@ sha3 = { workspace = true }
[dev-dependencies]
rayon = { workspace = true }
criterion2 = { workspace = true }
[[bench]]
name = "hashcash"
harness = false
@@ -0,0 +1,28 @@
use std::hint::black_box;
use criterion::{criterion_group, criterion_main, BenchmarkId, Criterion};
use affine_common::hashcash::Stamp;
fn bench_hashcash(c: &mut Criterion) {
let mut group = c.benchmark_group("hashcash");
group.bench_function(BenchmarkId::from_parameter("Generate"), |b| {
b.iter(|| {
black_box(Stamp::mint("test".to_string(), Some(20)).format());
});
});
group.bench_function(BenchmarkId::from_parameter("Verify"), |b| {
b.iter(|| {
black_box(
Stamp::try_from("1:20:20241114061212:test::RsRAAkoxjr4FattQ:292f0d")
.unwrap()
.check(20, "test"),
);
});
});
}
criterion_group!(benches, bench_hashcash);
criterion_main!(benches);