-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Use a separate interner type for UniqueTypeId #87867
Conversation
r? @wesleywiser (rust-highfive has picked a reviewer for you, use r? to override) |
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit a35943dfb8749ea72b73d4b77eb0a039e0b69424 with merge 476bbb073a2cb29fca275fdb4960f71270623a3c... |
☀️ Try build successful - checks-actions |
Queued 476bbb073a2cb29fca275fdb4960f71270623a3c with parent e8c25f2, future comparison URL. |
use rustc_arena::DroplessArena; | ||
|
||
#[derive(Copy, Hash, Eq, PartialEq, Clone)] | ||
pub(super) struct UniqueTypeId(u32); |
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.
This type used to be a wrapper around Symbol
with a Debug
derive that used the global interner, but the Symbol
would actually be interned by a separate interner.
Finished benchmarking try commit (476bbb073a2cb29fca275fdb4960f71270623a3c): comparison url. Summary: This benchmark run did not return any significant changes. If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. @bors rollup=never |
Up to 0.3% regressions all of which are for opt builds, which shouldn't have debuginfo generation and thus not run the changed code. Maybe it affects cgu partitioning or inlining? |
Ping from triage: |
Using symbol::Interner makes it very easy to mixup UniqueTypeId symbols with the global interner. In fact the Debug implementation of UniqueTypeId did exactly this. Using a separate interner type also avoids prefilling the interner with unused symbols and allow for optimizing the symbol interner for parallel access without negatively affecting the single threaded module codegen.
a35943d
to
8c7840e
Compare
Rebased |
@bors r+ |
📌 Commit 8c7840e has been approved by |
⌛ Testing commit 8c7840e with merge dd52fb9058f3ddbb2e2f28460169860e7f387176... |
The job Click to see the possible cause of the failure (guessed by this bot)
|
💔 Test failed - checks-actions |
⌛ Testing commit 8c7840e with merge 9e8b44cb5b43b95c220986e4fbab1fa8fc6c7930... |
The job Click to see the possible cause of the failure (guessed by this bot)
|
💔 Test failed - checks-actions |
The Windows Github Action Runners are broken atm: #88924 |
☀️ Test successful - checks-actions |
Finished benchmarking commit (2c7bc5e): comparison url. Summary: This benchmark run did not return any relevant changes. If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. @rustbot label: -perf-regression |
…ark-Simulacrum Move the Lock into symbol::Interner This makes it easier to make the symbol interner (near) lock free in case of concurrent accesses in the future. With rust-lang#87867 landed this shouldn't affect performance anymore.
@bjorn3 This makes rust-semverver confused (e.g. on https://github.com/rust-lang/rust-semverver/blob/b49417044bd4e9833e218b5f370388d9fe191661/src/changes.rs#L1463-L1464). Since some parts ( |
Nornally I think having your own interner is the best solution. The previous setup made it too easy to mixup between different interners, which will result in incorrect results (for example In this specific case I think only |
Got it, thanks for the pointer! |
Using symbol::Interner makes it very easy to mixup UniqueTypeId symbols
with the global interner. In fact the Debug implementation of
UniqueTypeId did exactly this.
Using a separate interner type also avoids prefilling the interner with
unused symbols and allow for optimizing the symbol interner for parallel
access without negatively affecting the single threaded module codegen.