Skip to content

Commit

Permalink
fix fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
jack60612 committed Aug 3, 2024
1 parent 4a8f26e commit 7abff83
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions benches/sha256_hash.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use criterion::{criterion_group, criterion_main, Criterion, black_box};
use criterion::{black_box, criterion_group, criterion_main, Criterion};

use clvmr::sha2::Sha256;

Expand All @@ -24,14 +24,16 @@ fn sha256_hash_benchmark(c: &mut Criterion) {
let mut group = c.benchmark_group("sha256_hash");

group.bench_function("hash_benchmark", |b| {
b.iter(|| { black_box(
// this figures out how many iterations to run.
for val in 0..MAX_VAL {
for len in BYTE_LENGTHS {
let bytes = gen_bytes(val, len);
hash_bytes(&bytes);
}
})
b.iter(|| {
black_box(
// this figures out how many iterations to run.
for val in 0..MAX_VAL {
for len in BYTE_LENGTHS {
let bytes = gen_bytes(val, len);
hash_bytes(&bytes);
}
},
)
})
});
// create
Expand Down

0 comments on commit 7abff83

Please sign in to comment.