2017-09-07 20:00:08 +00:00
|
|
|
#![feature(test)]
|
|
|
|
extern crate melib;
|
2018-08-04 17:30:21 +00:00
|
|
|
use melib::conf::Folder;
|
2017-09-07 20:00:08 +00:00
|
|
|
use melib::mailbox::backends::maildir::*;
|
|
|
|
|
|
|
|
extern crate test;
|
|
|
|
use self::test::Bencher;
|
|
|
|
|
|
|
|
#[bench]
|
|
|
|
fn bench_threads_1(b: &mut Bencher) {
|
2018-08-04 17:30:21 +00:00
|
|
|
b.iter(|| {
|
2018-08-11 15:00:21 +00:00
|
|
|
let folder = Folder::new(String::from(""), String::from(""), vec![]);
|
2018-08-04 17:30:21 +00:00
|
|
|
MaildirType::new("").multicore(1, &folder)
|
|
|
|
});
|
2017-09-07 20:00:08 +00:00
|
|
|
}
|
|
|
|
#[bench]
|
|
|
|
fn bench_threads_2(b: &mut Bencher) {
|
2018-08-04 17:30:21 +00:00
|
|
|
b.iter(|| {
|
2018-08-11 15:00:21 +00:00
|
|
|
let folder = Folder::new(String::from(""), String::from(""), vec![]);
|
2018-08-04 17:30:21 +00:00
|
|
|
MaildirType::new("").multicore(2, &folder)
|
|
|
|
});
|
2017-09-07 20:00:08 +00:00
|
|
|
}
|
|
|
|
#[bench]
|
|
|
|
fn bench_threads_3(b: &mut Bencher) {
|
2018-08-04 17:30:21 +00:00
|
|
|
b.iter(|| {
|
2018-08-11 15:00:21 +00:00
|
|
|
let folder = Folder::new(String::from(""), String::from(""), vec![]);
|
2018-08-04 17:30:21 +00:00
|
|
|
MaildirType::new("").multicore(3, &folder)
|
|
|
|
});
|
2017-09-07 20:00:08 +00:00
|
|
|
}
|
|
|
|
#[bench]
|
|
|
|
fn bench_threads_4(b: &mut Bencher) {
|
2018-08-04 17:30:21 +00:00
|
|
|
b.iter(|| {
|
2018-08-11 15:00:21 +00:00
|
|
|
let folder = Folder::new(String::from(""), String::from(""), vec![]);
|
2018-08-04 17:30:21 +00:00
|
|
|
MaildirType::new("").multicore(4, &folder)
|
|
|
|
});
|
2017-09-07 20:00:08 +00:00
|
|
|
}
|
|
|
|
#[bench]
|
|
|
|
fn bench_threads_6(b: &mut Bencher) {
|
2018-08-04 17:30:21 +00:00
|
|
|
b.iter(|| {
|
2018-08-11 15:00:21 +00:00
|
|
|
let folder = Folder::new(String::from(""), String::from(""), vec![]);
|
2018-08-04 17:30:21 +00:00
|
|
|
MaildirType::new("").multicore(6, &folder)
|
|
|
|
});
|
2017-09-07 20:00:08 +00:00
|
|
|
}
|