-
-
Notifications
You must be signed in to change notification settings - Fork 51
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 the result of Demangling #1124
Conversation
Demangling can be an expensive operation, which also happens for every frame and is not deduplicated for the same function names shared across threads. Furthermore, we capture errors for demangling failures, to eventually be able to improve those. However we are being spammed with up to 8 of those errors a second, and they are highly duplicated too, making it difficult to actually find new cases we don’t handle yet. So lets cache all the things, to avoid duplicated work and spamming S4S events.
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #1124 +/- ##
==========================================
+ Coverage 73.81% 73.89% +0.07%
==========================================
Files 86 86
Lines 12717 12748 +31
==========================================
+ Hits 9387 9420 +33
+ Misses 3330 3328 -2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a great idea 👍
); | ||
relative_addr.and_then(|addr| { | ||
symbolicate_native_frame( | ||
demangle_cache, | ||
symcache, | ||
lookup_result, | ||
addr, | ||
frame, | ||
index, | ||
) | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: IMO this is nicer with ?
.
); | |
relative_addr.and_then(|addr| { | |
symbolicate_native_frame( | |
demangle_cache, | |
symcache, | |
lookup_result, | |
addr, | |
frame, | |
index, | |
) | |
}) | |
)?; | |
symbolicate_native_frame( | |
demangle_cache, | |
symcache, | |
lookup_result, | |
relative_addr, | |
frame, | |
index, | |
) |
A followup to this review comment: #1124 (review)
A followup to this review comment: #1124 (review)
A followup to this review comment: #1124 (review)
Demangling can be an expensive operation, which also happens for every frame and is not deduplicated for the same function names shared across threads. Furthermore, we capture errors for demangling failures, to eventually be able to improve those. However we are being spammed with up to 8 of those errors a second, and they are highly duplicated too, making it difficult to actually find new cases we don’t handle yet.
So lets cache all the things, to avoid duplicated work and spamming S4S events.
The change to
get_relative_caller_addr
is a driveby refactoring as clippy was rightfully complaining about too many fn arguments.#skip-changelog