-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Exceptions and stack trace overheads #45999
Comments
|
To be precise, the remote sleuthing I did pointed towards https://github.com/libunwind/libunwind/blob/3be832395426b72248969247a4a66e3c3623578d/src/dwarf/Gfind_proc_info-lsb.c#L806-L808 The profile had ~60% of time spent in the syscall In particular there is a different path in https://github.com/libunwind/libunwind/blob/1f79a05edbd5c06240f8a15187b106831076540e/src/dwarf/Gparser.c#L468 that we are not hitting that might be faster. But it is kinda ludicrous that each |
That syscall seems unjustified also libunwind/libunwind@d3fad3a |
That sounds unavoidable then? @vchuravy's suggestion:
Sounds reasonable to me. For a particular backtrace exploration, will the set of object files loaded be static? Can a thread |
It might, and that might get us wedged into a really bad state if it happened anyways. In practice, never use |
On reflection, I don't think that could happen. If we're walking the stack for an exception and an address from a shared object is on the stack, it should be impossible for the reference count of the shared object to drop to 0. |
Yeah I think the frames were inlined. |
We observe two significant performance issues with exception handling:
SectionRef::containsSymbol
andELFObjectFile::getSymbolAddress
). Any suggestions/ideas for how to improve this would be very helpful!throw
can take very slow paths. Here's one:dl_iterate_phdr
walks through a list of shared objects; this can be a long list. We observe this call graph reasonably often; I'm not sure if that has anything to do with the environment (EC2 instance). Our large sysimage seems to exacerbate the performance problem here as well. I also found that exceptions are thrown not infrequently in type inference which is another performance hit.I'm not sure what a good solution here would be. A couple of ideas:
throw
time, record the bare minimum and build out the backtrace only when/if it is needed. Implementing this might be gnarly.throw_light
or similar when using exceptions for control flow. This is kinda ugly.Any other ideas? I do see references to caching certain information in
libunwind
code, but I'm not familiar enough with the codebase to understand if this is being done sufficiently.Cc: @vchuravy, @JeffBezanson, @vtjnash
Edited to correct per the following two comments.
The text was updated successfully, but these errors were encountered: