-
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
Remove NamedVarMap
.
#136270
Remove NamedVarMap
.
#136270
Conversation
`NamedVarMap` is extremely similar to `ResolveBoundVars`. The former contains two `UnordMap<ItemLocalId, T>` fields (obscured behind `ItemLocalMap` typedefs). The latter contains two `SortedMap<ItemLocalId, T>` fields. We construct a `NamedVarMap` and then convert it into a `ResolveBoundVars` by sorting the `UnordMap`s, which is unnecessary busywork. This commit removes `NamedVarMap` and constructs a `ResolveBoundVars` directly. `SortedMap` and `NamedVarMap` have slightly different perf characteristics during construction (e.g. speed of insertion) but this code isn't hot enough for that to matter. A few details to note. - A `FIXME` comment is removed. - The detailed comments on the fields of `NamedVarMap` are copied to `ResolveBoundVars` (which has a single, incorrect comment). - `BoundVarContext::map` is renamed. - `ResolveBoundVars` gets a derived `Default` impl.
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
Remove `NamedVarMap`. `NamedVarMap` is extremely similar to `ResolveBoundVars`. The former contains two `UnordMap<ItemLocalId, T>` fields (obscured behind `ItemLocalMap` typedefs). The latter contains two `SortedMap<ItemLocalId, T>` fields. We construct a `NamedVarMap` and then convert it into a `ResolveBoundVars` by sorting the `UnordMap`s, which is unnecessary busywork. This commit removes `NamedVarMap` and constructs a `ResolveBoundVars` directly. `SortedMap` and `NamedVarMap` have slightly different perf characteristics during construction (e.g. speed of insertion) but this code isn't hot enough for that to matter. A few details to note. - A `FIXME` comment is removed. - The detailed comments on the fields of `NamedVarMap` are copied to `ResolveBoundVars` (which has a single, incorrect comment). - `BoundVarContext::map` is renamed. - `ResolveBoundVars` gets a derived `Default` impl. r? `@ghost`
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (78f2ee6): comparison URL. Overall result: ✅ improvements - no action neededBenchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf. @bors rollup=never Instruction countThis is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.
Max RSS (memory usage)Results (primary 2.5%, secondary 2.2%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResults (secondary -1.0%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 775.772s -> 776.605s (0.11%) |
No perf effect, as expected. |
@bors rollup |
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.
One question, r=me with it answered
@bors r=jackh726 |
Rollup of 8 pull requests Successful merges: - rust-lang#135414 (Stabilize `const_black_box`) - rust-lang#136150 (ci: use windows 2025 for i686-mingw) - rust-lang#136258 (rustdoc: rename `issue-\d+.rs` tests to have meaningful names (part 11)) - rust-lang#136270 (Remove `NamedVarMap`.) - rust-lang#136278 (add constraint graph to polonius MIR dump) - rust-lang#136287 (LLVM changed the nocapture attribute to captures(none)) - rust-lang#136291 (some test suite cleanups) - rust-lang#136296 (float::min/max: mention the non-determinism around signed 0) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#136270 - nnethercote:rm-NamedVarMap, r=jackh726 Remove `NamedVarMap`. `NamedVarMap` is extremely similar to `ResolveBoundVars`. The former contains two `UnordMap<ItemLocalId, T>` fields (obscured behind `ItemLocalMap` typedefs). The latter contains two `SortedMap<ItemLocalId, T>` fields. We construct a `NamedVarMap` and then convert it into a `ResolveBoundVars` by sorting the `UnordMap`s, which is unnecessary busywork. This commit removes `NamedVarMap` and constructs a `ResolveBoundVars` directly. `SortedMap` and `NamedVarMap` have slightly different perf characteristics during construction (e.g. speed of insertion) but this code isn't hot enough for that to matter. A few details to note. - A `FIXME` comment is removed. - The detailed comments on the fields of `NamedVarMap` are copied to `ResolveBoundVars` (which has a single, incorrect comment). - `BoundVarContext::map` is renamed. - `ResolveBoundVars` gets a derived `Default` impl. r? `@jackh726`
NamedVarMap
is extremely similar toResolveBoundVars
. The former contains twoUnordMap<ItemLocalId, T>
fields (obscured behindItemLocalMap
typedefs). The latter contains twoSortedMap<ItemLocalId, T>
fields. We construct aNamedVarMap
and then convert it into aResolveBoundVars
by sorting theUnordMap
s, which is unnecessary busywork.This commit removes
NamedVarMap
and constructs aResolveBoundVars
directly.SortedMap
andNamedVarMap
have slightly different perf characteristics during construction (e.g. speed of insertion) but this code isn't hot enough for that to matter.A few details to note.
FIXME
comment is removed.NamedVarMap
are copied toResolveBoundVars
(which has a single, incorrect comment).BoundVarContext::map
is renamed.ResolveBoundVars
gets a derivedDefault
impl.r? @jackh726