Skip to content
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

Merged
merged 1 commit into from
Mar 31, 2023
Merged

Conversation

scottmcm
Copy link
Member

Moves the methods that don't need full IndexVec-ness over to IndexSlice, and have IndexVec deref to IndexSlice 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.

Moves the methods that don't need full `IndexVec`-ness over to `IndexSlice`, and have `IndexVec` deref to `IndexSlice` so everything keeps working.
@rustbot
Copy link
Collaborator

rustbot commented Mar 30, 2023

r? @cjgillot

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Mar 30, 2023
}

#[inline]
pub fn into_iter(self) -> vec::IntoIter<T> {
self.raw.into_iter()
pub fn drain_enumerated<'a, R: RangeBounds<usize>>(
Copy link
Member Author

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.

@cjgillot
Copy link
Contributor

IndexVec is a pretty core data structure in the compiler, so
@bors try @rust-timer queue

r=me if perf is clean

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Mar 30, 2023
@bors
Copy link
Contributor

bors commented Mar 30, 2023

⌛ Trying commit 408e2ac with merge 6121a6ef8b6dafddcbbd5693b95c697437b69a29...

@bors
Copy link
Contributor

bors commented Mar 30, 2023

☀️ Try build successful - checks-actions
Build commit: 6121a6ef8b6dafddcbbd5693b95c697437b69a29 (6121a6ef8b6dafddcbbd5693b95c697437b69a29)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (6121a6ef8b6dafddcbbd5693b95c697437b69a29): comparison URL.

Overall result: ✅ improvements - no action needed

Benchmarking 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
@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.3% [-0.3%, -0.3%] 1
Improvements ✅
(secondary)
-1.1% [-2.0%, -0.6%] 3
All ❌✅ (primary) -0.3% [-0.3%, -0.3%] 1

Max RSS (memory usage)

Results

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.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
2.3% [2.3%, 2.3%] 1
Improvements ✅
(primary)
-3.6% [-3.6%, -3.6%] 1
Improvements ✅
(secondary)
-2.0% [-2.6%, -1.4%] 3
All ❌✅ (primary) -3.6% [-3.6%, -3.6%] 1

Cycles

Results

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.

mean range count
Regressions ❌
(primary)
3.0% [0.8%, 5.2%] 9
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 3.0% [0.8%, 5.2%] 9

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Mar 31, 2023
@scottmcm
Copy link
Member Author

scottmcm commented Mar 31, 2023

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 -0.01% overall, so I think this is really just neutral.)

@bors
Copy link
Contributor

bors commented Mar 31, 2023

📌 Commit 408e2ac has been approved by cjgillot

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 31, 2023
@bors
Copy link
Contributor

bors commented Mar 31, 2023

⌛ Testing commit 408e2ac with merge 480068c...

@bors
Copy link
Contributor

bors commented Mar 31, 2023

☀️ Test successful - checks-actions
Approved by: cjgillot
Pushing 480068c to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Mar 31, 2023
@bors bors merged commit 480068c into rust-lang:master Mar 31, 2023
@rustbot rustbot added this to the 1.70.0 milestone Mar 31, 2023
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (480068c): comparison URL.

Overall result: ✅ improvements - no action needed

@rustbot label: -perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.3% [-0.3%, -0.3%] 1
Improvements ✅
(secondary)
-0.5% [-0.5%, -0.4%] 2
All ❌✅ (primary) -0.3% [-0.3%, -0.3%] 1

Max RSS (memory usage)

Results

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.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.4% [-2.4%, -2.4%] 1
All ❌✅ (primary) - - 0

Cycles

This benchmark run did not return any relevant results for this metric.

@scottmcm scottmcm deleted the index-slice branch March 31, 2023 15:50
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 2, 2023
…-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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants