#![feature(test)]
extern crate test;
extern crate rustfft;
use test::Bencher;
use rustfft::num_complex::Complex;
fn bench_fft(b: &mut Bencher, len: usize) {
let mut planner = rustfft::FFTplanner::new(false);
let fft = planner.plan_fft(len);
let mut signal = vec![Complex{re: 0_f32, im: 0_f32}; len];
let mut spectrum = signal.clone();
b.iter(|| {fft.process(&mut signal, &mut spectrum);} );
}
#[bench] fn complex_p2_00128(b: &mut Bencher) { bench_fft(b, 128); }
#[bench] fn complex_p2_00512(b: &mut Bencher) { bench_fft(b, 512); }
#[bench] fn complex_p2_02048(b: &mut Bencher) { bench_fft(b, 2048); }
#[bench] fn complex_p2_08192(b: &mut Bencher) { bench_fft(b, 8192); }
#[bench] fn complex_p2_32768(b: &mut Bencher) { bench_fft(b, 32768); }
#[bench] fn complex_p4_00064(b: &mut Bencher) { bench_fft(b, 64); }
#[bench] fn complex_p4_00256(b: &mut Bencher) { bench_fft(b, 256); }
#[bench] fn complex_p4_01024(b: &mut Bencher) { bench_fft(b, 1024); }
#[bench] fn complex_p4_04096(b: &mut Bencher) { bench_fft(b, 4096); }
#[bench] fn complex_p4_16384(b: &mut Bencher) { bench_fft(b, 16384); }
#[bench] fn complex_p7_00343(b: &mut Bencher) { bench_fft(b, 343); }
#[bench] fn complex_p7_02401(b: &mut Bencher) { bench_fft(b, 2401); }
#[bench] fn complex_p7_16807(b: &mut Bencher) { bench_fft(b, 16807); }
#[bench] fn complex_prime_0019(b: &mut Bencher) { bench_fft(b, 19); }
#[bench] fn complex_prime_0151(b: &mut Bencher) { bench_fft(b, 151); }
#[bench] fn complex_prime_1009(b: &mut Bencher) { bench_fft(b, 1009); }
#[bench] fn complex_prime_2017(b: &mut Bencher) { bench_fft(b, 2017); }
#[bench] fn complex_primepower_44521(b: &mut Bencher) { bench_fft(b, 44521); } #[bench] fn complex_primepower_160801(b: &mut Bencher) { bench_fft(b, 160801); }
#[bench] fn complex_composite_24576(b: &mut Bencher) { bench_fft(b, 24576); }
#[bench] fn complex_composite_20736(b: &mut Bencher) { bench_fft(b, 20736); }
#[bench] fn complex_composite_32192(b: &mut Bencher) { bench_fft(b, 32192); }
#[bench] fn complex_composite_24028(b: &mut Bencher) { bench_fft(b, 24028); }
#[bench] fn complex_composite_30270(b: &mut Bencher) { bench_fft(b, 30270); }