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

Cache function attributes #152

Merged
merged 3 commits into from
Dec 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 24 additions & 6 deletions benches/bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,12 +199,18 @@ fn context_query_with_functions_rc(b: &mut test::Bencher) {
let ctx = addr2line::Context::new(file).unwrap();
// Ensure nothing is lazily loaded.
for addr in &addresses {
test::black_box(ctx.find_frames(*addr)).ok();
let mut frames = ctx.find_frames(*addr).unwrap();
while let Ok(Some(ref frame)) = frames.next() {
test::black_box(frame);
}
}

b.iter(|| {
for addr in &addresses {
test::black_box(ctx.find_frames(*addr)).ok();
let mut frames = ctx.find_frames(*addr).unwrap();
while let Ok(Some(ref frame)) = frames.next() {
test::black_box(frame);
}
}
});
});
Expand All @@ -222,12 +228,18 @@ fn context_query_with_functions_slice(b: &mut test::Bencher) {
let ctx = addr2line::Context::from_dwarf(dwarf).unwrap();
// Ensure nothing is lazily loaded.
for addr in &addresses {
test::black_box(ctx.find_frames(*addr)).ok();
let mut frames = ctx.find_frames(*addr).unwrap();
while let Ok(Some(ref frame)) = frames.next() {
test::black_box(frame);
}
}

b.iter(|| {
for addr in &addresses {
test::black_box(ctx.find_frames(*addr)).ok();
let mut frames = ctx.find_frames(*addr).unwrap();
while let Ok(Some(ref frame)) = frames.next() {
test::black_box(frame);
}
}
});
});
Expand Down Expand Up @@ -277,7 +289,10 @@ fn context_new_and_query_with_functions_rc(b: &mut test::Bencher) {
b.iter(|| {
let ctx = addr2line::Context::new(file).unwrap();
for addr in addresses.iter().take(100) {
test::black_box(ctx.find_frames(*addr)).ok();
let mut frames = ctx.find_frames(*addr).unwrap();
while let Ok(Some(ref frame)) = frames.next() {
test::black_box(frame);
}
}
});
});
Expand All @@ -294,7 +309,10 @@ fn context_new_and_query_with_functions_slice(b: &mut test::Bencher) {
let dwarf = dwarf_borrow(&dwarf);
let ctx = addr2line::Context::from_dwarf(dwarf).unwrap();
for addr in addresses.iter().take(100) {
test::black_box(ctx.find_frames(*addr)).ok();
let mut frames = ctx.find_frames(*addr).unwrap();
while let Ok(Some(ref frame)) = frames.next() {
test::black_box(frame);
}
}
});
});
Expand Down
Loading