-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
[Experiment] Don't merge vtables for improved debugging. #103514
[Experiment] Don't merge vtables for improved debugging. #103514
Conversation
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 0247c6a with merge 65f47026b47e75096d402bd8cd83f87bd1994c82... |
☀️ Try build successful - checks-actions |
Queued 65f47026b47e75096d402bd8cd83f87bd1994c82 with parent 31d754a, future comparison URL. |
Finished benchmarking commit (65f47026b47e75096d402bd8cd83f87bd1994c82): comparison URL. Overall result: ✅ improvements - no action neededBenchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf. @bors rollup=never Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)This benchmark run did not return any relevant results for this metric. CyclesThis benchmark run did not return any relevant results for this metric. Footnotes |
OK, it looks like performance isn't noticeably affected by this change. I suspect that vtables already don't get merged that often, so the price of making sure it never happens shouldn't be too high. I'll close this PR and open a cleaned-up version that just enables this when full debuginfo is requested. |
…s-when-debuginfo, r=WaffleLapkin Don't merge vtables when full debuginfo is enabled. This PR makes the compiler not emit the `unnamed_addr` attribute for vtables when full debuginfo is enabled, so that they don't get merged even if they have the same contents. This allows debuggers to more reliably map from a dyn pointer to the self-type of a trait object by looking at the vtable's debuginfo. The PR only changes the behavior of the LLVM backend as other backends don't emit vtable debuginfo (as far as I can tell). The performance impact of this change should be small as [measured](rust-lang#103514 (comment)) in a previous PR.
With this PR I'd like to test the performance and size impact of making vtables unique by removing the
unnamed_addr
attribute from them. Having unique vtables is good for debuginfo, because it allows to map from adyn
pointer to the self-type of the trait-object by looking at the vtable's debuginfo. If vtables are merged, we lose this ability because we might get the wrong self-type.This PR disables vtable merging unconditionally, so we can see the impact on perf.rlo. An actual implementation would likely only disable it when full debuginfo is enabled.
r? @ghost