rust/benches/fibonacci.rs

27 lines
535 B
Rust
Raw Normal View History

2016-06-17 23:35:34 -05:00
#![feature(test, rustc_private)]
2016-05-30 07:05:50 -05:00
extern crate test;
2018-11-17 05:24:27 -06:00
use crate::test::Bencher;
2016-06-17 23:35:34 -05:00
mod helpers;
2018-11-17 05:24:27 -06:00
use crate::helpers::*;
2016-05-30 07:05:50 -05:00
#[bench]
fn fib(bencher: &mut Bencher) {
bencher.iter(|| { fibonacci_helper::main(); })
2016-05-30 07:05:50 -05:00
}
#[bench]
fn fib_miri(bencher: &mut Bencher) {
miri_helper::run("fibonacci_helper", bencher);
}
#[bench]
fn fib_iter(bencher: &mut Bencher) {
bencher.iter(|| { fibonacci_helper_iterative::main(); })
2016-05-30 07:05:50 -05:00
}
#[bench]
fn fib_iter_miri(bencher: &mut Bencher) {
miri_helper::run("fibonacci_helper_iterative", bencher);
}