#![feature(test)]

extern crate test;
extern crate bit_vec;
extern crate bio;

use test::Bencher;

use bio::alignment::distance::*;

// 5,000 random nucleotides, GC content = .55
static STR_1: &'static [u8] = b"[encoded data, 5000 characters]";
// 5,000 random nucleotides, GC content = .45
static STR_2: &'static [u8] = b"[encoded data, 5000 characters]";
// 5,000 random nucleotides, GC content = .0
static STR_3: &'static [u8] = b"[encoded data, 5000 characters]";
// 5,000 random nucleotides, GC content = 1.
static STR_4: &'static [u8] = b"[encoded data, 5000 characters]";

#[bench]
fn bench_hamming_dist_equal_str_1000iter(b: &mut Bencher) {
    b.iter(|| {
        for _ in 0..1000 {
            hamming(STR_1, STR_1).unwrap();
        }
    });
}

#[bench]
fn bench_hamming_dist_diverse_str_1000iter(b: &mut Bencher) {
    b.iter(|| {
        for _ in 0..1000 {
            hamming(STR_1, STR_2).unwrap();
        }
        });
}

#[bench]
fn bench_levenshtein_dist_equal_str(b: &mut Bencher) {
    b.iter(|| { levenshtein(STR_1, STR_1) });
}

#[bench]
fn bench_levenshtein_dist_diverse_str(b: &mut Bencher) {
    b.iter(|| { levenshtein(STR_1, STR_2) });
}

#[bench]
fn bench_levenshtein_dist_worst_str(b: &mut Bencher) {
    b.iter(|| { levenshtein(STR_3, STR_4) });
}