Skip to content

Add Layout::array_unchecked so that RawVec can use it #126871

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

Closed
wants to merge 1 commit into from

Conversation

scottmcm
Copy link
Member

@scottmcm scottmcm commented Jun 23, 2024

It's implementing it itself, so we should make a real API for it.

r? ghost

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jun 23, 2024
@scottmcm scottmcm force-pushed the layout-const-for-type branch from ff134f4 to 8e1ff77 Compare June 23, 2024 18:38
@scottmcm
Copy link
Member Author

@bors try @rust-timer queue

@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 Jun 23, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 23, 2024
Make `Layout::new::<T>()` a constant instead of multiple NullOps

rust-lang#72189 and rust-lang#79827 suggest that this is perf-relevant, so let's see what happens.

r? ghost
@bors
Copy link
Collaborator

bors commented Jun 23, 2024

⌛ Trying commit 8e1ff77 with merge f79e592...

@bors
Copy link
Collaborator

bors commented Jun 23, 2024

☀️ Try build successful - checks-actions
Build commit: f79e592 (f79e5927def1471f246b10965cbbc5649295d1ce)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (f79e592): comparison URL.

Overall result: ❌ regressions - 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.6% [0.3%, 0.9%] 2
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.6% [0.3%, 0.9%] 2

Max RSS (memory usage)

Results (primary 2.8%, secondary -4.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.

mean range count
Regressions ❌
(primary)
8.9% [5.5%, 15.3%] 3
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-6.3% [-7.2%, -5.4%] 2
Improvements ✅
(secondary)
-4.2% [-4.2%, -4.2%] 1
All ❌✅ (primary) 2.8% [-7.2%, 15.3%] 5

Cycles

Results (primary 1.8%)

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)
1.8% [1.0%, 4.5%] 6
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.8% [1.0%, 4.5%] 6

Binary size

Results (primary -0.0%, secondary -0.1%)

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.4% [0.0%, 1.1%] 13
Regressions ❌
(secondary)
0.2% [0.1%, 0.3%] 3
Improvements ✅
(primary)
-0.2% [-0.8%, -0.0%] 40
Improvements ✅
(secondary)
-0.2% [-0.3%, -0.1%] 7
All ❌✅ (primary) -0.0% [-0.8%, 1.1%] 53

Bootstrap: 691.47s -> 691.944s (0.07%)
Artifact size: 326.79 MiB -> 326.75 MiB (-0.01%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jun 23, 2024
@scottmcm scottmcm closed this Jul 3, 2024
@scottmcm scottmcm reopened this Jul 3, 2024
@scottmcm scottmcm force-pushed the layout-const-for-type branch from 8e1ff77 to cd623ee Compare July 3, 2024 03:02
@rust-log-analyzer

This comment has been minimized.

Instead of it writing the code for it itself.
@scottmcm scottmcm force-pushed the layout-const-for-type branch from cd623ee to 1b3be3e Compare July 3, 2024 03:49
@scottmcm scottmcm changed the title Make Layout::new::<T>() a constant instead of multiple NullOps Add Layout::array_unchecked so that RawVec can do it Jul 3, 2024
@scottmcm scottmcm changed the title Add Layout::array_unchecked so that RawVec can do it Add Layout::array_unchecked so that RawVec can use it Jul 3, 2024
@scottmcm
Copy link
Member Author

scottmcm commented Jul 3, 2024

@bors try @rust-timer queue

@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 Jul 3, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 3, 2024
Add `Layout::array_unchecked` so that `RawVec` can use it

It's implementing it itself, so we should make a real API for it.

r? ghost
@bors
Copy link
Collaborator

bors commented Jul 3, 2024

⌛ Trying commit 1b3be3e with merge a4697a6...

@bors
Copy link
Collaborator

bors commented Jul 3, 2024

☀️ Try build successful - checks-actions
Build commit: a4697a6 (a4697a6c401a09cb125ea60298e0946652f97991)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (a4697a6): comparison URL.

Overall result: ❌✅ regressions and improvements - 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.

Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please fix the regressions and do another perf run. If the next run shows neutral or positive results, the label will be automatically removed.

@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.3% [0.3%, 0.3%] 1
Regressions ❌
(secondary)
4.5% [4.5%, 4.5%] 1
Improvements ✅
(primary)
-0.7% [-1.0%, -0.3%] 2
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.4% [-1.0%, 0.3%] 3

Max RSS (memory usage)

Results (primary 0.1%, secondary -4.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.

mean range count
Regressions ❌
(primary)
3.5% [3.5%, 3.5%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-3.3% [-3.3%, -3.3%] 1
Improvements ✅
(secondary)
-4.0% [-4.0%, -4.0%] 1
All ❌✅ (primary) 0.1% [-3.3%, 3.5%] 2

Cycles

Results (primary -1.3%, secondary -4.8%)

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)
-1.3% [-1.3%, -1.3%] 1
Improvements ✅
(secondary)
-4.8% [-7.3%, -2.9%] 6
All ❌✅ (primary) -1.3% [-1.3%, -1.3%] 1

Binary size

Results (primary 0.2%, secondary 0.3%)

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.3% [0.0%, 0.9%] 62
Regressions ❌
(secondary)
0.3% [0.2%, 0.4%] 7
Improvements ✅
(primary)
-0.3% [-0.3%, -0.3%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.2% [-0.3%, 0.9%] 63

Bootstrap: 697.439s -> 695.657s (-0.26%)
Artifact size: 327.71 MiB -> 327.73 MiB (0.01%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Jul 3, 2024
@scottmcm scottmcm closed this Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
perf-regression Performance regression. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library 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