Skip to content

Commit

Permalink
fix(compilation): fix benchmark compilation on non-linux platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
bnjbvr committed Feb 18, 2025
1 parent 8d9d83f commit 2671769
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 6 additions & 2 deletions benchmarks/benches/room_bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,12 +198,16 @@ pub fn load_pinned_events_benchmark(c: &mut Criterion) {
}

fn criterion() -> Criterion {
if cfg!(target_os = "linux") {
#[cfg(target_os = "linux")]
{
Criterion::default().with_profiler(pprof::criterion::PProfProfiler::new(
100,
pprof::criterion::Output::Flamegraph(None),
))
} else {
}

#[cfg(not(target_os = "linux"))]
{
Criterion::default()
}
}
Expand Down
8 changes: 6 additions & 2 deletions benchmarks/benches/timeline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,16 @@ pub fn create_timeline_with_initial_events(c: &mut Criterion) {
}

fn criterion() -> Criterion {
if cfg!(target_os = "linux") {
#[cfg(target_os = "linux")]
{
Criterion::default().with_profiler(pprof::criterion::PProfProfiler::new(
100,
pprof::criterion::Output::Flamegraph(None),
))
} else {
}

#[cfg(not(target_os = "linux"))]
{
Criterion::default()
}
}
Expand Down

0 comments on commit 2671769

Please sign in to comment.