Uh oh!
There was an error while loading. Please reload this page.
cache symbol names in ty::maps - #41507
Conversation
There was a problem hiding this comment.
What do you mean by "don't rely on interning or equality here"? Maybe you mean for equality? The main thing to be careful of (which &'tcx str would solve) is that we hash the string contents (if you use Symbol, things go awry).
There was a problem hiding this comment.
Actually, that comment was needed because a previous try used Symbol there, which as you said is dangerous. I'll remove it.
There was a problem hiding this comment.
Why not just remove 'a? I think I added it in my PR expressly for this field. But whatever, seems fine.
There was a problem hiding this comment.
Missed that. Didn't want to cause unnecessary diffs.
There was a problem hiding this comment.
Shouldn't we just replace this entire function with a call to symbol_name (and change return type to InternedString, of course)? It seems like we should remove the secondary caching performed by SymbolMap, and instead have that also use the queries, no?
nikomatsakis
left a comment
There was a problem hiding this comment.
LGTM, but I'm curious what you think about removing the SymbolMap too.
There was a problem hiding this comment.
I'm confused by this. Aren't there sometimes multiple items with the same node-id that nonetheless deserve a consistent ordering (e.g., different instantiations of the same instance?)
nikomatsakis
left a comment
There was a problem hiding this comment.
Curious about the sorting thing, otherwise seems good.
There was a problem hiding this comment.
👍 to making this a method, the fn was awkward.
There was a problem hiding this comment.
Total nit, but I'd expect tcx to be the first argument. Having this be a method seems even better (didn't you do this elsewhere? Or is that just for TransItem?) But I don't care much.
There was a problem hiding this comment.
It was this way originally. Let me move it all the way to a method on Instance.
a8c9623 to
1199e3eCompareThere was a problem hiding this comment.
👍 simpler this way anyhow
arielb1
commented
Apr 24, 2017
@bors r=nikomatsakis |
bors
commented
Apr 24, 2017
📌 Commit af63f14 has been approved by |
arielb1
commented
Apr 24, 2017
Fixed @bors r=nikomatsakis |
bors
commented
Apr 24, 2017
📌 Commit 07d1233 has been approved by |
bors
commented
Apr 26, 2017
☔ The latest upstream changes (presumably #41504) made this pull request unmergeable. Please resolve the merge conflicts. |
this fixes a performance regression introduced in commit 39a58c3.
arielb1
commented
Apr 26, 2017
@bors r=nikomatsakis |
bors
commented
Apr 26, 2017
📌 Commit 07b16cb has been approved by |
bors
commented
Apr 27, 2017
⌛ Testing commit 07b16cb with merge aed35b2... |
bors
commented
Apr 27, 2017
💔 Test failed - status-appveyor |
aidanhs
commented
Apr 27, 2017
@bors retry Appveyor network issues https://appveyor.statuspage.io/incidents/06gzq846jl9x |
bors
commented
Apr 27, 2017
⌛ Testing commit 07b16cb with merge 4961d72... |
cache symbol names in ty::maps this fixes a performance regression introduced in commit 39a58c3. r? @nikomatsakis
bors
commented
Apr 27, 2017
☀️ Test successful - status-appveyor, status-travis |
this fixes a performance regression introduced in commit 39a58c3.
r? @nikomatsakis