crypto: Make pprof a Linux specific dependency
parent
fc6ff4288e
commit
e1d4fe533d
|
@ -52,6 +52,8 @@ http = "0.2.3"
|
||||||
matrix-sdk-test = { version = "0.2.0", path = "../matrix_sdk_test" }
|
matrix-sdk-test = { version = "0.2.0", path = "../matrix_sdk_test" }
|
||||||
indoc = "1.0.3"
|
indoc = "1.0.3"
|
||||||
criterion = { version = "0.3.4", features = ["async", "async_futures", "html_reports"] }
|
criterion = { version = "0.3.4", features = ["async", "async_futures", "html_reports"] }
|
||||||
|
|
||||||
|
[target.'cfg(target_os = "linux")'.dev-dependencies]
|
||||||
pprof = { version = "0.4.2", features = ["flamegraph"] }
|
pprof = { version = "0.4.2", features = ["flamegraph"] }
|
||||||
|
|
||||||
[[bench]]
|
[[bench]]
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
#[cfg(target_os = "linux")]
|
||||||
mod perf;
|
mod perf;
|
||||||
|
|
||||||
use std::convert::TryFrom;
|
use std::convert::TryFrom;
|
||||||
|
@ -101,7 +102,12 @@ pub fn keys_claiming(c: &mut Criterion) {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn criterion() -> Criterion {
|
fn criterion() -> Criterion {
|
||||||
Criterion::default().with_profiler(perf::FlamegraphProfiler::new(100))
|
#[cfg(target_os = "linux")]
|
||||||
|
let criterion = Criterion::default().with_profiler(perf::FlamegraphProfiler::new(100));
|
||||||
|
#[cfg(not(target_os = "linux"))]
|
||||||
|
let criterion = Criterion::default();
|
||||||
|
|
||||||
|
criterion
|
||||||
}
|
}
|
||||||
|
|
||||||
criterion_group! {
|
criterion_group! {
|
||||||
|
|
Loading…
Reference in New Issue