Reorganize benches.
This commit is contained in:
parent
f4cf3f3636
commit
c6ec4f4397
7 changed files with 14 additions and 21 deletions
|
@ -1,11 +1,9 @@
|
|||
#![feature(custom_attribute, test)]
|
||||
#![feature(rustc_private)]
|
||||
#![allow(unused_attributes)]
|
||||
#![feature(test, rustc_private)]
|
||||
|
||||
extern crate test;
|
||||
use test::Bencher;
|
||||
|
||||
mod fibonacci_helper;
|
||||
mod helpers;
|
||||
use helpers::*;
|
||||
|
||||
#[bench]
|
||||
fn fib(bencher: &mut Bencher) {
|
||||
|
@ -14,15 +12,11 @@ fn fib(bencher: &mut Bencher) {
|
|||
})
|
||||
}
|
||||
|
||||
mod miri_helper;
|
||||
|
||||
#[bench]
|
||||
fn fib_miri(bencher: &mut Bencher) {
|
||||
miri_helper::run("fibonacci_helper", bencher);
|
||||
}
|
||||
|
||||
mod fibonacci_helper_iterative;
|
||||
|
||||
#[bench]
|
||||
fn fib_iter(bencher: &mut Bencher) {
|
||||
bencher.iter(|| {
|
||||
|
|
|
@ -1,7 +1,3 @@
|
|||
#![feature(custom_attribute, test)]
|
||||
#![feature(rustc_private)]
|
||||
#![allow(unused_attributes)]
|
||||
|
||||
extern crate getopts;
|
||||
extern crate miri;
|
||||
extern crate rustc;
|
||||
|
@ -32,7 +28,7 @@ fn find_sysroot() -> String {
|
|||
pub fn run(filename: &str, bencher: &mut Bencher) {
|
||||
let args = &[
|
||||
"miri".to_string(),
|
||||
format!("benches/{}.rs", filename),
|
||||
format!("benches/helpers/{}.rs", filename),
|
||||
"--sysroot".to_string(),
|
||||
find_sysroot()
|
||||
];
|
7
benches/helpers/mod.rs
Normal file
7
benches/helpers/mod.rs
Normal file
|
@ -0,0 +1,7 @@
|
|||
// This module gets included in multiple crates, and they each only use part of it.
|
||||
#![allow(dead_code)]
|
||||
|
||||
pub mod fibonacci_helper;
|
||||
pub mod fibonacci_helper_iterative;
|
||||
pub mod miri_helper;
|
||||
pub mod smoke_helper;
|
|
@ -1,11 +1,9 @@
|
|||
#![feature(custom_attribute, test)]
|
||||
#![feature(rustc_private)]
|
||||
#![allow(unused_attributes)]
|
||||
#![feature(test, rustc_private)]
|
||||
|
||||
extern crate test;
|
||||
use test::Bencher;
|
||||
|
||||
mod smoke_helper;
|
||||
mod helpers;
|
||||
use helpers::*;
|
||||
|
||||
#[bench]
|
||||
fn noop(bencher: &mut Bencher) {
|
||||
|
@ -33,8 +31,6 @@ fn noop_miri_full(bencher: &mut Bencher) {
|
|||
}
|
||||
*/
|
||||
|
||||
mod miri_helper;
|
||||
|
||||
#[bench]
|
||||
fn noop_miri_interpreter(bencher: &mut Bencher) {
|
||||
miri_helper::run("smoke_helper", bencher);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue