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.
I assumed this is already true due to how GLOBALS and threads are created.
There was a problem hiding this comment.
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. |
| with_interner(|interner| interner.intern(string)) | ||
| } | ||
|
|
||
| pub fn interned(self) -> Self { |
|
@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