iai bench

This commit is contained in:
Robin Appelman 2021-03-27 21:29:05 +01:00
commit 7537958e6c
3 changed files with 16 additions and 2 deletions

View file

@ -18,4 +18,8 @@ regex = { version = "1", default-features = false }
once_cell = "1"
[dev-dependencies]
iai = "0.1"
iai = "0.1"
[[bench]]
name = "iai"
harness = false

10
benches/iai.rs Normal file
View file

@ -0,0 +1,10 @@
use iai::black_box;
use palantir::get_metrics;
use tokio::runtime::Runtime;
fn iai_get_metrics() -> String {
let rt = Runtime::new().unwrap();
rt.block_on(async { black_box(get_metrics().await.unwrap()) })
}
iai::main!(iai_get_metrics);

View file

@ -1,4 +1,4 @@
pub mod heim;
pub(crate) mod heim;
mod zfs;
use crate::heim::*;