-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Tweak Symbol
and InternedString
#60659
Tweak Symbol
and InternedString
#60659
Conversation
@bors try |
…=<try> Tweak `Symbol` and `InternedString` Some minor improvements to speed and code cleanliness. r? @Zoxc
☀️ Try build successful - checks-travis |
@rust-timer build 9a6dab6 |
Success: Queued 9a6dab6 with parent 9f83961, comparison URL. |
I got miniscule improvements locally, but I think it's worthwhile from the clean-up angle. |
// | ||
// FIXME: ensure that the interner outlives any thread which uses | ||
// `LocalInternedString`, by creating a new thread right after constructing the | ||
// interner. |
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.
@Zoxc , I don't think this FIXME is necessary?
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.
Why not?
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 assumed this is already true due to how GLOBALS
and threads are created.
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 it happens do be done that way now, but it's not enforced or documented as required by symbol.rs
.
Could you revert the |
Finished benchmarking try commit 9a6dab6 |
This lets comparisons occur with a single access to the interner, instead of two.
Lots of details I wish I'd known when I first looked at this code.
It's not used.
3e5e8d3
to
e53bb1a
Compare
@petrochenkov: New code is up. |
@@ -367,10 +380,6 @@ impl Symbol { | |||
with_interner(|interner| interner.intern(string)) | |||
} | |||
|
|||
pub fn interned(self) -> Self { |
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.
Why is this removed?
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.
No longer used.
@bors r+ |
📌 Commit e53bb1a has been approved by |
…edString, r=Zoxc Tweak `Symbol` and `InternedString` Some minor improvements to speed and code cleanliness. r? @Zoxc
Rollup of 6 pull requests Successful merges: - #60529 (RFC 2008: Uninhabitedness fixes for enum variants and tests) - #60620 (Fix a couple of FIXMEs in ext::tt::transcribe) - #60659 (Tweak `Symbol` and `InternedString`) - #60692 (Extend #60676 test for nested mut patterns.) - #60697 (add regression test for #60629) - #60701 (Update mailmap for mati865) Failed merges: r? @ghost
Some minor improvements to speed and code cleanliness.
r? @Zoxc