Skip to content

Commit

Permalink
fix(benches): place unix dep under compiler flag
Browse files Browse the repository at this point in the history
- Without it compiler error in win is caused.
  • Loading branch information
oetyng committed Mar 23, 2023
1 parent f1e4b22 commit 3ccac46
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions benches/reissue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,15 @@ fn bench_reissue_1_to_100(c: &mut Criterion) {
let tx = &dbc_builder.transaction;

c.bench_function(&format!("reissue split 1 to {N_OUTPUTS}"), |b| {
#[cfg(unix)]
let guard = pprof::ProfilerGuard::new(100).unwrap();

b.iter(|| {
TransactionVerifier::verify(&spentbook.key_manager, black_box(tx), &spent_proofs)
.unwrap();
});

#[cfg(unix)]
if let Ok(report) = guard.report().build() {
let file =
std::fs::File::create(format!("reissue_split_1_to_{N_OUTPUTS}.svg")).unwrap();
Expand Down Expand Up @@ -124,13 +126,15 @@ fn bench_reissue_100_to_1(c: &mut Criterion) {
let tx = &merge_dbc_builder.transaction;

c.bench_function(&format!("reissue merge {N_OUTPUTS} to 1"), |b| {
#[cfg(unix)]
let guard = pprof::ProfilerGuard::new(100).unwrap();

b.iter(|| {
TransactionVerifier::verify(&spentbook_node.key_manager, black_box(tx), &spent_proofs)
.unwrap();
});

#[cfg(unix)]
if let Ok(report) = guard.report().build() {
let file =
std::fs::File::create(format!("reissue_merge_{N_OUTPUTS}_to_1.svg")).unwrap();
Expand Down

0 comments on commit 3ccac46

Please sign in to comment.