#![cfg(test)]

extern crate criterion;
extern crate criterion_bencher_compat;
extern crate num;

use rust_samples::swapper::{
    CAllocaSwapper, CLoopSwapper, CMallocSwapper, LoopSwapper, PtrSwapper, Swapper,
};

use criterion::measurement::WallTime;
use criterion::{black_box, criterion_group, criterion_main, Bencher, Criterion};
use heapless::consts::{U10, U100, U1000, U10000, U100000, U1000000};
use num::{one, zero, Num};

fn bench_swap<S, T, N>(b: &mut Bencher<WallTime>)
where
    S: Swapper,
    N: heapless::ArrayLength<T>,
    T: Num + Copy,
{
    let (mut arr1, mut arr2) = bench_swap_setup::<T, N>();

    b.iter(|| {
        S::swap(&mut arr1, &mut arr2);
        black_box(&arr1);
        black_box(&arr2);
    });
}

/// Allocates two vectors of fixed length on the heap.
fn bench_swap_setup<T, N>() -> (Vec<T>, Vec<T>)
where
    N: heapless::ArrayLength<T>,
    T: Num + Clone,
{
    let mut arr1: Vec<T> = Vec::new();
    let mut arr2 = arr1.clone();

    arr1.resize(N::to_usize(), black_box(zero()));
    arr2.resize(N::to_usize(), black_box(one()));

    (arr1, arr2)
}

/// A heapless version of `bench_swap_setup`.
fn _bench_swap_setup_heapless<T, N>() -> (heapless::Vec<T, N>, heapless::Vec<T, N>)
where
    N: heapless::ArrayLength<T>,
    T: Num + Clone,
{
    let mut arr1: heapless::Vec<T, N> = heapless::Vec::new();
    let mut arr2 = arr1.clone();

    arr1.resize(N::to_usize(), black_box(zero()))
        .expect("insufficient stack space");
    arr2.resize(N::to_usize(), black_box(one()))
        .expect("insufficient stack space");

    (arr1, arr2)
}

type BenchInt = u8;

fn bench_swap_loop_len_10(c: &mut Criterion) {
    c.bench_function("swap_loop_len_10", |b| {
        bench_swap::<LoopSwapper, BenchInt, U10>(b)
    });
}

fn bench_swap_loop_len_100(c: &mut Criterion) {
    c.bench_function("swap_loop_len_100", |b| {
        bench_swap::<LoopSwapper, BenchInt, U100>(b)
    });
}

fn bench_swap_loop_len_1000(c: &mut Criterion) {
    c.bench_function("swap_loop_len_1000", |b| {
        bench_swap::<LoopSwapper, BenchInt, U1000>(b)
    });
}

fn bench_swap_loop_len_10000(c: &mut Criterion) {
    c.bench_function("swap_loop_len_10000", |b| {
        bench_swap::<LoopSwapper, BenchInt, U10000>(b)
    });
}

fn bench_swap_loop_len_100000(c: &mut Criterion) {
    c.bench_function("swap_loop_len_100000", |b| {
        bench_swap::<LoopSwapper, BenchInt, U100000>(b)
    });
}

fn bench_swap_loop_len_1000000(c: &mut Criterion) {
    c.bench_function("swap_loop_len_1000000", |b| {
        bench_swap::<LoopSwapper, BenchInt, U1000000>(b)
    });
}

fn bench_swap_ptrswap_len_10(c: &mut Criterion) {
    c.bench_function("swap_ptrswap_len_10", |b| {
        bench_swap::<PtrSwapper, BenchInt, U10>(b)
    });
}

fn bench_swap_ptrswap_len_100(c: &mut Criterion) {
    c.bench_function("swap_ptrswap_len_100", |b| {
        bench_swap::<PtrSwapper, BenchInt, U100>(b)
    });
}

fn bench_swap_ptrswap_len_1000(c: &mut Criterion) {
    c.bench_function("swap_ptrswap_len_1000", |b| {
        bench_swap::<PtrSwapper, BenchInt, U1000>(b)
    });
}

fn bench_swap_ptrswap_len_10000(c: &mut Criterion) {
    c.bench_function("swap_ptrswap_len_10000", |b| {
        bench_swap::<PtrSwapper, BenchInt, U10000>(b)
    });
}

fn bench_swap_ptrswap_len_100000(c: &mut Criterion) {
    c.bench_function("swap_ptrswap_len_100000", |b| {
        bench_swap::<PtrSwapper, BenchInt, U100000>(b)
    });
}

fn bench_swap_ptrswap_len_1000000(c: &mut Criterion) {
    c.bench_function("swap_ptrswap_len_1000000", |b| {
        bench_swap::<PtrSwapper, BenchInt, U1000000>(b)
    });
}

fn bench_cswap_loop_len_10(c: &mut Criterion) {
    c.bench_function("cswap_loop_len_10", |b| {
        bench_swap::<CLoopSwapper, BenchInt, U10>(b)
    });
}

fn bench_cswap_loop_len_100(c: &mut Criterion) {
    c.bench_function("cswap_loop_len_100", |b| {
        bench_swap::<CLoopSwapper, BenchInt, U100>(b)
    });
}

fn bench_cswap_loop_len_1000(c: &mut Criterion) {
    c.bench_function("cswap_loop_len_1000", |b| {
        bench_swap::<CLoopSwapper, BenchInt, U1000>(b)
    });
}

fn bench_cswap_loop_len_10000(c: &mut Criterion) {
    c.bench_function("cswap_loop_len_10000", |b| {
        bench_swap::<CLoopSwapper, BenchInt, U10000>(b)
    });
}

fn bench_cswap_loop_len_100000(c: &mut Criterion) {
    c.bench_function("cswap_loop_len_100000", |b| {
        bench_swap::<CLoopSwapper, BenchInt, U100000>(b)
    });
}

fn bench_cswap_loop_len_1000000(c: &mut Criterion) {
    c.bench_function("cswap_loop_len_1000000", |b| {
        bench_swap::<CLoopSwapper, BenchInt, U1000000>(b)
    });
}

fn bench_cswap_alloca_len_10(c: &mut Criterion) {
    c.bench_function("cswap_alloca_len_10", |b| {
        bench_swap::<CAllocaSwapper, BenchInt, U10>(b)
    });
}

fn bench_cswap_alloca_len_100(c: &mut Criterion) {
    c.bench_function("cswap_alloca_len_100", |b| {
        bench_swap::<CAllocaSwapper, BenchInt, U100>(b)
    });
}

fn bench_cswap_alloca_len_1000(c: &mut Criterion) {
    c.bench_function("cswap_alloca_len_1000", |b| {
        bench_swap::<CAllocaSwapper, BenchInt, U1000>(b)
    });
}

fn bench_cswap_alloca_len_10000(c: &mut Criterion) {
    c.bench_function("cswap_alloca_len_10000", |b| {
        bench_swap::<CAllocaSwapper, BenchInt, U10000>(b)
    });
}

fn bench_cswap_alloca_len_100000(c: &mut Criterion) {
    c.bench_function("cswap_alloca_len_100000", |b| {
        bench_swap::<CAllocaSwapper, BenchInt, U100000>(b)
    });
}

fn bench_cswap_alloca_len_1000000(c: &mut Criterion) {
    c.bench_function("cswap_alloca_len_1000000", |b| {
        bench_swap::<CAllocaSwapper, BenchInt, U1000000>(b)
    });
}

fn bench_cswap_malloc_len_10(c: &mut Criterion) {
    c.bench_function("cswap_malloc_len_10", |b| {
        bench_swap::<CMallocSwapper, BenchInt, U10>(b)
    });
}

fn bench_cswap_malloc_len_100(c: &mut Criterion) {
    c.bench_function("cswap_malloc_len_100", |b| {
        bench_swap::<CMallocSwapper, BenchInt, U100>(b)
    });
}

fn bench_cswap_malloc_len_1000(c: &mut Criterion) {
    c.bench_function("cswap_malloc_len_1000", |b| {
        bench_swap::<CMallocSwapper, BenchInt, U1000>(b)
    });
}

fn bench_cswap_malloc_len_10000(c: &mut Criterion) {
    c.bench_function("cswap_malloc_len_10000", |b| {
        bench_swap::<CMallocSwapper, BenchInt, U10000>(b)
    });
}

fn bench_cswap_malloc_len_100000(c: &mut Criterion) {
    c.bench_function("cswap_malloc_len_100000", |b| {
        bench_swap::<CMallocSwapper, BenchInt, U100000>(b)
    });
}

fn bench_cswap_malloc_len_1000000(c: &mut Criterion) {
    c.bench_function("cswap_malloc_len_1000000", |b| {
        bench_swap::<CMallocSwapper, BenchInt, U1000000>(b)
    });
}

criterion_group!(
    benches,
    bench_swap_loop_len_10,
    bench_swap_loop_len_100,
    bench_swap_loop_len_1000,
    bench_swap_loop_len_10000,
    bench_swap_loop_len_100000,
    bench_swap_loop_len_1000000,
    bench_swap_ptrswap_len_10,
    bench_swap_ptrswap_len_100,
    bench_swap_ptrswap_len_1000,
    bench_swap_ptrswap_len_10000,
    bench_swap_ptrswap_len_100000,
    bench_swap_ptrswap_len_1000000,
    bench_cswap_loop_len_10,
    bench_cswap_loop_len_100,
    bench_cswap_loop_len_1000,
    bench_cswap_loop_len_10000,
    bench_cswap_loop_len_100000,
    bench_cswap_loop_len_1000000,
    bench_cswap_alloca_len_10,
    bench_cswap_alloca_len_100,
    bench_cswap_alloca_len_1000,
    bench_cswap_alloca_len_10000,
    bench_cswap_alloca_len_100000,
    bench_cswap_alloca_len_1000000,
    bench_cswap_malloc_len_10,
    bench_cswap_malloc_len_100,
    bench_cswap_malloc_len_1000,
    bench_cswap_malloc_len_10000,
    bench_cswap_malloc_len_100000,
    bench_cswap_malloc_len_1000000
);
criterion_main!(benches);
