-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7e20e7d
commit 3bc602c
Showing
5 changed files
with
140 additions
and
123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,17 @@ | ||
use criterion::{black_box, criterion_group, criterion_main, Criterion}; | ||
use lightswitch::unwind_info::{to_vec, remove_redundant, remove_unnecesary_markers}; | ||
use lightswitch::unwind_info::{remove_redundant, remove_unnecesary_markers, to_vec}; | ||
|
||
const NODE_EXE: &'static str = "/home/javierhonduco/.vscode-server/cli/servers/Stable-e170252f762678dec6ca2cc69aba1570769a5d39/server/node"; | ||
const NODE_EXE: &'static str = "/opt/redpanda/libexec/redpanda"; | ||
|
||
pub fn criterion_benchmark(c: &mut Criterion) { | ||
c.bench_function("unwind info + sorting", |b| b.iter(|| { | ||
let mut found_unwind_info = to_vec(NODE_EXE).unwrap(); | ||
found_unwind_info.sort_by(|a, b| { | ||
let a_pc = a.pc; | ||
let b_pc = b.pc; | ||
a_pc.cmp(&b_pc) | ||
}); | ||
|
||
black_box(found_unwind_info); | ||
// let found_unwind_info = remove_unnecesary_markers(&found_unwind_info); | ||
// black_box(remove_redundant(&found_unwind_info)); | ||
})); | ||
c.bench_function("unwind info + sorting", |b| { | ||
b.iter(|| { | ||
let mut found_unwind_info = to_vec(NODE_EXE).unwrap(); | ||
remove_unnecesary_markers(&mut found_unwind_info); | ||
black_box(remove_redundant(&mut found_unwind_info)); | ||
}) | ||
}); | ||
} | ||
|
||
criterion_group!(benches, criterion_benchmark); | ||
criterion_main!(benches); | ||
criterion_main!(benches); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters