Add a first benchmark
This commit is contained in:
parent
7e797ab644
commit
db56ea6fe4
2 changed files with 19 additions and 0 deletions
|
@ -10,3 +10,10 @@ publish = false
|
|||
[dependencies]
|
||||
pbkdf2 = "0.12.2"
|
||||
sha2 = "0.10.8"
|
||||
|
||||
[dev-dependencies]
|
||||
criterion = { version = "0.5.1", features = ["html_reports"] }
|
||||
|
||||
[[bench]]
|
||||
name = "small"
|
||||
harness = false
|
||||
|
|
12
benches/small.rs
Normal file
12
benches/small.rs
Normal file
|
@ -0,0 +1,12 @@
|
|||
use criterion::{black_box, criterion_group, criterion_main, Criterion};
|
||||
use rust_job_scheduling::algorithm::*;
|
||||
use rust_job_scheduling::data::SMALL;
|
||||
|
||||
fn criterion_benchmark(c: &mut Criterion) {
|
||||
c.bench_function("single thread", |b| {
|
||||
b.iter(|| single_thread(black_box(SMALL)))
|
||||
});
|
||||
}
|
||||
|
||||
criterion_group!(benches, criterion_benchmark);
|
||||
criterion_main!(benches);
|
Loading…
Reference in a new issue