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-29.0.0 ./ext/cargo-vendor/itertools-0.12.1/benches/combinations_with_replacement.rs
wasmtime-28.0.0 ./ext/cargo-vendor/itertools-0.12.1/benches/combinations_with_replacement.rs
wasmtime-27.0.0 ./ext/cargo-vendor/itertools-0.12.1/benches/combinations_with_replacement.rs
wasmtime-26.0.0 ./ext/cargo-vendor/itertools-0.12.1/benches/combinations_with_replacement.rs
wasmtime-25.0.2 ./ext/cargo-vendor/itertools-0.12.1/benches/combinations_with_replacement.rs
wasmtime-25.0.1 ./ext/cargo-vendor/itertools-0.12.1/benches/combinations_with_replacement.rs
wasmtime-25.0.0 ./ext/cargo-vendor/itertools-0.12.1/benches/combinations_with_replacement.rs
wasmtime-24.0.0 ./ext/cargo-vendor/itertools-0.12.1/benches/combinations_with_replacement.rs
wasmtime-23.0.2 ./ext/cargo-vendor/itertools-0.12.1/benches/combinations_with_replacement.rs
wasmtime-22.0.0 ./ext/cargo-vendor/itertools-0.12.1/benches/combinations_with_replacement.rs
wasmtime-21.0.1 ./ext/cargo-vendor/itertools-0.12.1/benches/combinations_with_replacement.rs
wasmtime-20.0.2 ./ext/cargo-vendor/itertools-0.12.1/benches/combinations_with_replacement.rs
wasmtime-20.0.0 ./ext/cargo-vendor/itertools-0.12.1/benches/combinations_with_replacement.rs
wasmtime-18.0.3 ./ext/cargo-vendor/itertools-0.10.5/benches/combinations_with_replacement.rs
wasmtime-17.0.1 ./ext/cargo-vendor/itertools-0.10.5/benches/combinations_with_replacement.rs
wasmtime-17.0.0 ./ext/cargo-vendor/itertools-0.10.5/benches/combinations_with_replacement.rs
wasmtime-16.0.0 ./ext/cargo-vendor/itertools-0.10.5/benches/combinations_with_replacement.rs
wasmtime-15.0.1 ./ext/cargo-vendor/itertools-0.10.5/benches/combinations_with_replacement.rs
wasmtime-15.0.0 ./ext/cargo-vendor/itertools-0.10.5/benches/combinations_with_replacement.rs
wasmtime-14.0.4 ./ext/cargo-vendor/itertools-0.10.5/benches/combinations_with_replacement.rs