-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Add IndexSlice
to go with IndexVec
#109787
Conversation
Moves the methods that don't need full `IndexVec`-ness over to `IndexSlice`, and have `IndexVec` deref to `IndexSlice` so everything keeps working.
r? @cjgillot (rustbot has picked a reviewer for you, use r? to override) |
} | ||
|
||
#[inline] | ||
pub fn into_iter(self) -> vec::IntoIter<T> { | ||
self.raw.into_iter() | ||
pub fn drain_enumerated<'a, R: RangeBounds<usize>>( |
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.
Sorry, the diff is pretty bad because moving them to a different impl
block mixes the order.
r=me if perf is clean |
This comment has been minimized.
This comment has been minimized.
⌛ Trying commit 408e2ac with merge 6121a6ef8b6dafddcbbd5693b95c697437b69a29... |
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (6121a6ef8b6dafddcbbd5693b95c697437b69a29): 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 a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis 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.
CyclesResultsThis 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.
|
Well, I'm not convinced those improvements are real, but at least it confirmed no regressions, so @bors r=cjgillot (Looking at all the wall time, even the non-relevant results, says |
☀️ Test successful - checks-actions |
Finished benchmarking commit (480068c): comparison URL. Overall result: ✅ improvements - no action needed@rustbot label: -perf-regression Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis 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.
CyclesThis benchmark run did not return any relevant results for this metric. |
…-obk Use `FieldIdx` in various things related to aggregates Shrank `AggregateKind` by 8 bytes on x64, since the active field of a union is tracked as an `Option<FieldIdx>` instead of `Option<usize>`. Part 3/? of rust-lang/compiler-team#606 [`IndexSlice`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_index/vec/struct.IndexVec.html#deref-methods-IndexSlice%3CI,+T%3E) was added in rust-lang#109787
Moves the methods that don't need full
IndexVec
-ness over toIndexSlice
, and haveIndexVec
deref toIndexSlice
so everything keeps working.Doing this for later use in rust-lang/compiler-team#606, where I'm hitting a bunch of things that are just slices and thus there's no way to index with the
FieldIdx
.