-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Symbols in optimized async programs are often not useful #65978
Copy link
Copy link
Closed
Labels
A-async-awaitArea: Async & AwaitArea: Async & AwaitA-codegenArea: Code generationArea: Code generationA-debuginfoArea: Debugging information in compiled programs (DWARF, PDB, etc.)Area: Debugging information in compiled programs (DWARF, PDB, etc.)AsyncAwait-TriagedAsync-await issues that have been triaged during a working group meeting.Async-await issues that have been triaged during a working group meeting.C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.P-mediumMedium priorityMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-async-awaitArea: Async & AwaitArea: Async & AwaitA-codegenArea: Code generationArea: Code generationA-debuginfoArea: Debugging information in compiled programs (DWARF, PDB, etc.)Area: Debugging information in compiled programs (DWARF, PDB, etc.)AsyncAwait-TriagedAsync-await issues that have been triaged during a working group meeting.Async-await issues that have been triaged during a working group meeting.C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.P-mediumMedium priorityMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
(As observed on
rustc 1.40.0-nightly (4a8c5b20c 2019-10-23)targetingthumbv7em-none-eabihf; CC @tmandry)I'm making my first aggressive use of
async fnin an application. It's a deeply-embedded performance-sensitive application, and I wind up inspecting the disassembly output a lot (usingobjdump).This is complicated by the fact that basically all of my functions are named
poll_with_tls_context. (Some of them aren't -- some of them are named after future combinators.)For example, here is my function called
poll_with_tls_contextcalling another one, also namedpoll_with_tls_context:(The observant reader will note
poll_with_tls_contextdoes not appear in libcore. That's correct -- I've hackedasyncin a#[no_std]environment. I'm pretty sure the hack is not the problem.)I understand why this is happening:
poll_with_tls_contextis an implementation detail of the current lowering ofasync fn, and it is being specialized to the future type it's given, hence many such functions. But I also don't think it's ideal.(For what it's worth, I can change the situation by forcing
poll_with_tls_contextto inline, though this produces unacceptable code bloat in my application (and this option isn't available for people who aren't open to using a patched libstd). By default,poll_with_tls_contextdoesn't inline, butget_task_contextdoes, which seems like the right result for size/speed.)I am compiling at
opt-level = 3with an override fordebug = truein my release profile.