Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Pprof Profiling to Existing Benchmarks #273

Merged
merged 24 commits into from
Nov 11, 2022
Merged
Prev Previous commit
Next Next commit
revert
  • Loading branch information
oojo12 committed Nov 9, 2022
commit 096a743b53eae82a2230cb9c2a7f244443aa09d6
6 changes: 1 addition & 5 deletions algorithms/linfa-clustering/benches/appx_dbscan.rs
Original file line number Diff line number Diff line change
@@ -9,11 +9,9 @@ use ndarray::Array2;
use ndarray_rand::rand::SeedableRng;
use ndarray_rand::rand_distr::Uniform;
use ndarray_rand::RandomExt;
#[cfg(not(target_os = "windows"))]
use pprof::criterion::{Output, PProfProfiler};
use rand_xoshiro::Xoshiro256Plus;

#[cfg(not(target_os = "windows"))]
fn appx_dbscan_bench(c: &mut Criterion) {
let mut rng = Xoshiro256Plus::seed_from_u64(40);
let cluster_sizes_and_slacks = vec![
@@ -51,11 +49,9 @@ fn appx_dbscan_bench(c: &mut Criterion) {
benchmark.finish();
}

#[cfg(not(target_os = "windows"))]
criterion_group! {
name = benches;
config = Criterion::default().with_profiler(PProfProfiler::new(100, Output::Flamegraph(None)));
targets = appx_dbscan_bench
}
#[cfg(not(target_os = "windows"))]
criterion_main!(benches);
criterion_main!(benches);