diff --git a/benches/bench1.rs b/benches/bench1.rs index fbcaa05a7..4d38b67c7 100644 --- a/benches/bench1.rs +++ b/benches/bench1.rs @@ -836,6 +836,17 @@ fn with_position_fold(c: &mut Criterion) { }); } +fn tuple_combinations_fold(c: &mut Criterion) { + let v = black_box((0..64).collect_vec()); + c.bench_function("tuple_combinations fold", move |b| { + b.iter(|| { + v.iter() + .tuple_combinations() + .fold(0, |acc, (a, b, c, d)| acc + *a * *c - *b * *d) + }) + }); +} + criterion_group!( benches, slice_iter, @@ -884,5 +895,6 @@ criterion_group!( permutations_range, permutations_slice, with_position_fold, + tuple_combinations_fold, ); criterion_main!(benches);