Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Use `Symbol` even more #60815
Use `Symbol` even more #60815
Conversation
|
I realize that this will need rebasing once #60740 lands. |
|
@bors try |
Use `Symbol` even more These patches simplify the code a bit (fewer conversions) and also speed things up a bit (fewer `with_interner` calls). r? @petrochenkov
|
|
|
@rust-timer build 8e849d8 |
|
Success: Queued 8e849d8 with parent 80e7cde, comparison URL. |
|
Finished benchmarking try commit 8e849d8 |
|
Any data structure using The |
|
@petrochenkov, do we still use gensym? IIRC, we pushed for using |
Sigh. My view is that |
|
More generally: the difference between
|
|
Apparently the issue in #48923 was caused by query infrastructure using both 1) I don't know whether it's possible to use only |
|
Finally, I had to work out the difference between |
|
Yes, IIRC, I was not able to come up with a regression test for the fix in #49695. Adding an assertion that would catch the error early was the best I was able to do at the time: rust/src/librustc/ty/query/plumbing.rs Lines 526 to 535 in fbb6275 |
67b969e
to
2175494
|
I have pushed new code that reverts the |
|
@bors try |
Use `Symbol` even more These patches simplify the code a bit (fewer conversions) and also speed things up a bit (fewer `with_interner` calls). r? @petrochenkov
|
|
|
@rust-timer build ac67417 |
|
Success: Queued ac67417 with parent 4f53b5c, comparison URL. |
|
Finished benchmarking try commit ac67417: comparison url |
|
Still a clear perf improvement with the new code. It would be good to land this. |
|
r? @petrochenkov @bors r+ |
|
|
It's a hot function, and a direct `Symbol` comparison is faster. The patch also converts some `&InternedString`s to `InternedString`.
`InternedString::intern(x)` is preferable to `Symbol::intern(x).as_interned_str()`, because the former involves one call to `with_interner` while the latter involves two. The case within InternedString::decode() is particularly hot, and this change reduces the number of `with_interner` calls by up to 13%.
`LocalInternedString::intern(x)` is preferable to `Symbol::intern(x).as_str()`, because the former involves one call to `with_interner` while the latter involves two.
2175494
to
c06cdbe
|
I rebased. @bors r=petrochenkov |
|
|
Use `Symbol` even more These patches simplify the code a bit (fewer conversions) and also speed things up a bit (fewer `with_interner` calls). r? @petrochenkov
|
|
These patches simplify the code a bit (fewer conversions) and also speed things up a bit (fewer
with_internercalls).r? @petrochenkov