Sha256: 11f29160652a2d90ce7ca4b1c339c4457888ab6867e2456ce1c62e3adf9be737

Contents?: true

Size: 1020 Bytes

Versions: 38

Compression:

Stored size: 1020 Bytes

Contents

use criterion::{black_box, criterion_group, criterion_main, Criterion};
use itertools::Itertools;

fn comb_replacement_n10_k5(c: &mut Criterion) {
    c.bench_function("comb replacement n10k5", move |b| {
        b.iter(|| {
            for i in (0..10).combinations_with_replacement(5) {
                black_box(i);
            }
        })
    });
}

fn comb_replacement_n5_k10(c: &mut Criterion) {
    c.bench_function("comb replacement n5 k10", move |b| {
        b.iter(|| {
            for i in (0..5).combinations_with_replacement(10) {
                black_box(i);
            }
        })
    });
}

fn comb_replacement_n10_k10(c: &mut Criterion) {
    c.bench_function("comb replacement n10 k10", move |b| {
        b.iter(|| {
            for i in (0..10).combinations_with_replacement(10) {
                black_box(i);
            }
        })
    });
}

criterion_group!(
    benches,
    comb_replacement_n10_k5,
    comb_replacement_n5_k10,
    comb_replacement_n10_k10,
);
criterion_main!(benches);

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
wasmtime-14.0.3 ./ext/cargo-vendor/itertools-0.10.5/benches/combinations_with_replacement.rs
wasmtime-14.0.1 ./ext/cargo-vendor/itertools-0.10.5/benches/combinations_with_replacement.rs
wasmtime-14.0.0 ./ext/cargo-vendor/itertools-0.10.5/benches/combinations_with_replacement.rs
wasmtime-13.0.0 ./ext/cargo-vendor/itertools-0.10.5/benches/combinations_with_replacement.rs
wasmtime-12.0.1 ./ext/cargo-vendor/itertools-0.10.5/benches/combinations_with_replacement.rs
wasmtime-12.0.0 ./ext/cargo-vendor/itertools-0.10.5/benches/combinations_with_replacement.rs
wasmtime-11.0.0 ./ext/cargo-vendor/itertools-0.10.5/benches/combinations_with_replacement.rs
wasmtime-10.0.1 ./ext/cargo-vendor/itertools-0.10.5/benches/combinations_with_replacement.rs
wasmtime-10.0.0 ./ext/cargo-vendor/itertools-0.10.5/benches/combinations_with_replacement.rs
wasmtime-9.0.4 ./ext/cargo-vendor/itertools-0.10.5/benches/combinations_with_replacement.rs
wasmtime-9.0.1 ./ext/cargo-vendor/itertools-0.10.5/benches/combinations_with_replacement.rs
wasmtime-8.0.0 ./ext/cargo-vendor/itertools-0.10.5/benches/combinations_with_replacement.rs
wasmtime-7.0.0 ./ext/cargo-vendor/itertools-0.10.5/benches/combinations_with_replacement.rs
wasmtime-6.0.1 ./ext/cargo-vendor/itertools-0.10.5/benches/combinations_with_replacement.rs
wasmtime-6.0.0 ./ext/cargo-vendor/itertools-0.10.5/benches/combinations_with_replacement.rs
wasmtime-5.0.0 ./ext/cargo-vendor/itertools-0.10.5/benches/combinations_with_replacement.rs
wasmtime-0.4.1 ./ext/cargo-vendor/itertools-0.10.5/benches/combinations_with_replacement.rs
wasmtime-0.4.0 ./ext/cargo-vendor/itertools-0.10.5/benches/combinations_with_replacement.rs