add an "extra long" benchmark
This commit is contained in:
parent
168e48b69c
commit
a63a57d94d
|
@ -5,7 +5,7 @@ use bencher::{benchmark_group, benchmark_main, Bencher};
|
|||
use instant_segment::test_data::{crate_data_dir, segmenter};
|
||||
use instant_segment::Search;
|
||||
|
||||
benchmark_group!(benches, short, long);
|
||||
benchmark_group!(benches, short, long, extra_long);
|
||||
benchmark_main!(benches);
|
||||
|
||||
fn short(bench: &mut Bencher) {
|
||||
|
@ -26,3 +26,14 @@ fn long(bench: &mut Bencher) {
|
|||
);
|
||||
});
|
||||
}
|
||||
|
||||
fn extra_long(bench: &mut Bencher) {
|
||||
let segmenter = segmenter(crate_data_dir());
|
||||
let mut search = Search::default();
|
||||
bench.iter(|| {
|
||||
let _ = segmenter.segment(
|
||||
"itwasthebestoftimesitwastheworstoftimesitwastheageofwisdomitwastheageoffoolishnessitwastheepochofbeliefitwastheepochofincredulityitwastheseasonoflightitwastheseasonofdarknessitwasthespringofhopeitwasthewinterofdespair",
|
||||
&mut search,
|
||||
);
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue