Skip to content

Commit

Permalink
Account for arity in benches.
Browse files Browse the repository at this point in the history
  • Loading branch information
porcuquine committed Jan 23, 2020
1 parent 46eba23 commit e7d538a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions benches/hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ fn bench_hash(c: &mut Criterion) {
.map(|(i, _)| scalar_from_u64(i as u64))
.collect();

let mut group = c.benchmark_group("hash");
let mut group = c.benchmark_group(format!("hash-{}", ARITY * 32));

group.bench_with_input(
BenchmarkId::new("Sha2 256", "Generated scalars"),
Expand All @@ -22,7 +22,7 @@ fn bench_hash(c: &mut Criterion) {
let mut h = Sha256::new();

std::iter::repeat(())
.take(WIDTH)
.take(ARITY)
.map(|_| s.choose(&mut OsRng).unwrap())
.for_each(|scalar| {
for val in scalar.into_repr().as_ref() {
Expand All @@ -43,7 +43,7 @@ fn bench_hash(c: &mut Criterion) {
let mut h = Sha512::new();

std::iter::repeat(())
.take(WIDTH)
.take(ARITY)
.map(|_| s.choose(&mut OsRng).unwrap())
.for_each(|scalar| {
for val in scalar.into_repr().as_ref() {
Expand All @@ -64,7 +64,7 @@ fn bench_hash(c: &mut Criterion) {
let mut h = Poseidon::default();

std::iter::repeat(())
.take(WIDTH)
.take(ARITY)
.map(|_| s.choose(&mut OsRng).unwrap())
.for_each(|scalar| {
h.input(*scalar).unwrap();
Expand Down

0 comments on commit e7d538a

Please sign in to comment.