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

Less generic code for Vec allocations #122396

Merged
merged 1 commit into from
Mar 27, 2024
Merged

Conversation

kornelski
Copy link
Contributor

Follow up to #120504 (comment) which hopefully makes compilation faster.

@rustbot
Copy link
Collaborator

rustbot commented Mar 12, 2024

r? @joboet

rustbot has assigned @joboet.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@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 Mar 12, 2024
@Noratrieb
Copy link
Member

@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 Mar 12, 2024
@bors
Copy link
Contributor

bors commented Mar 12, 2024

⌛ Trying commit 870d332 with merge 5af3381...

bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 12, 2024
Less generic code for Vec allocations

Follow up to rust-lang#120504 (comment) which hopefully makes compilation faster.
@bors
Copy link
Contributor

bors commented Mar 12, 2024

☀️ Try build successful - checks-actions
Build commit: 5af3381 (5af33816ce489bad2f393d82636f8c65bd99ba55)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (5af3381): 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.7% [-1.4%, -0.5%] 8
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.7% [-1.4%, -0.5%] 8

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)
4.4% [1.0%, 8.3%] 7
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-16.7% [-16.7%, -16.7%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.7% [-16.7%, 8.3%] 8

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

Binary size

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.5% [0.0%, 1.8%] 7
Regressions ❌
(secondary)
0.0% [0.0%, 0.0%] 11
Improvements ✅
(primary)
-0.3% [-0.9%, -0.0%] 68
Improvements ✅
(secondary)
-0.3% [-0.5%, -0.2%] 7
All ❌✅ (primary) -0.2% [-0.9%, 1.8%] 75

Bootstrap: 672.776s -> 672.488s (-0.04%)
Artifact size: 310.29 MiB -> 310.20 MiB (-0.03%)

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

@joboet joboet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like there are some very small performance gains, and this makes sense to me from a readability standpoint.

Just two things, and then this should be good to go!

library/alloc/src/raw_vec.rs Outdated Show resolved Hide resolved
library/alloc/src/vec/mod.rs Outdated Show resolved Hide resolved
library/alloc/src/raw_vec.rs Outdated Show resolved Hide resolved
library/alloc/src/vec/mod.rs Outdated Show resolved Hide resolved
@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 14, 2024
@joboet
Copy link
Member

joboet commented Mar 15, 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 Mar 15, 2024
@bors
Copy link
Contributor

bors commented Mar 15, 2024

⌛ Trying commit a7064e1 with merge 918ae71...

bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 15, 2024
Less generic code for Vec allocations

Follow up to rust-lang#120504 (comment) which hopefully makes compilation faster.
@bors

This comment was marked as outdated.

1 similar comment
@bors

This comment was marked as duplicate.

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (918ae71): 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.7% [0.7%, 0.7%] 2
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.7% [-1.3%, -0.5%] 6
Improvements ✅
(secondary)
-4.4% [-4.4%, -4.4%] 1
All ❌✅ (primary) -0.4% [-1.3%, 0.7%] 8

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)
6.1% [3.3%, 8.1%] 5
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-2.7% [-18.0%, -1.3%] 39
Improvements ✅
(secondary)
-2.7% [-4.2%, -0.7%] 66
All ❌✅ (primary) -1.7% [-18.0%, 8.1%] 44

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)
- - 0
Regressions ❌
(secondary)
4.1% [3.5%, 4.6%] 2
Improvements ✅
(primary)
-1.7% [-1.7%, -1.6%] 2
Improvements ✅
(secondary)
-2.6% [-2.6%, -2.6%] 1
All ❌✅ (primary) -1.7% [-1.7%, -1.6%] 2

Binary size

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.5% [0.0%, 1.9%] 8
Regressions ❌
(secondary)
0.0% [0.0%, 0.0%] 11
Improvements ✅
(primary)
-0.3% [-0.8%, -0.0%] 67
Improvements ✅
(secondary)
-0.2% [-0.3%, -0.2%] 4
All ❌✅ (primary) -0.2% [-0.8%, 1.9%] 75

Bootstrap: 669.125s -> 667.891s (-0.18%)
Artifact size: 311.46 MiB -> 311.42 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 Mar 15, 2024
@kornelski kornelski requested a review from joboet March 24, 2024 22:21
@workingjubilee
Copy link
Member

@bors r=joboet

@bors
Copy link
Contributor

bors commented Mar 25, 2024

📌 Commit 533d7d1 has been approved by joboet

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 25, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 26, 2024
Less generic code for Vec allocations

Follow up to rust-lang#120504 (comment) which hopefully makes compilation faster.
@bors
Copy link
Contributor

bors commented Mar 26, 2024

⌛ Testing commit 533d7d1 with merge 8de7649...

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Mar 26, 2024

💔 Test failed - checks-actions

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

I've removed word "reserve" from helper function name to avoid confusing tests that look for absence of functions like try_reserve.

@joboet
Copy link
Member

joboet commented Mar 27, 2024

Cool! r=me once CI comes in green.

@joboet
Copy link
Member

joboet commented Mar 27, 2024

@bors r+

@bors
Copy link
Contributor

bors commented Mar 27, 2024

📌 Commit 443e29c has been approved by joboet

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 27, 2024
@bors
Copy link
Contributor

bors commented Mar 27, 2024

⌛ Testing commit 443e29c with merge c9f8f34...

@bors
Copy link
Contributor

bors commented Mar 27, 2024

☀️ Test successful - checks-actions
Approved by: joboet
Pushing c9f8f34 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Mar 27, 2024
@bors bors merged commit c9f8f34 into rust-lang:master Mar 27, 2024
12 checks passed
@rustbot rustbot added this to the 1.79.0 milestone Mar 27, 2024
@kornelski kornelski deleted the vec-err-debloat branch March 27, 2024 22:13
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (c9f8f34): comparison URL.

Overall result: ❌✅ regressions and improvements - ACTION NEEDED

Next Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please open an issue or create a new PR that fixes the regressions, add a comment linking to the newly created issue or PR, and then add the perf-regression-triaged label to this PR.

@rustbot label: +perf-regression
cc @rust-lang/wg-compiler-performance

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.8%] 2
Regressions ❌
(secondary)
0.3% [0.3%, 0.3%] 1
Improvements ✅
(primary)
-0.5% [-1.4%, -0.1%] 12
Improvements ✅
(secondary)
-4.4% [-4.4%, -4.4%] 1
All ❌✅ (primary) -0.3% [-1.4%, 0.8%] 14

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)
3.2% [0.6%, 5.8%] 2
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-1.5% [-4.7%, -0.2%] 12
Improvements ✅
(secondary)
-3.6% [-3.6%, -3.6%] 1
All ❌✅ (primary) -0.8% [-4.7%, 5.8%] 14

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)
0.7% [0.5%, 1.0%] 6
Regressions ❌
(secondary)
3.4% [3.4%, 3.4%] 1
Improvements ✅
(primary)
-1.1% [-1.8%, -0.5%] 2
Improvements ✅
(secondary)
-3.3% [-4.3%, -2.4%] 2
All ❌✅ (primary) 0.2% [-1.8%, 1.0%] 8

Binary size

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.1% [0.0%, 0.2%] 16
Regressions ❌
(secondary)
0.0% [0.0%, 0.2%] 15
Improvements ✅
(primary)
-0.2% [-0.6%, -0.0%] 66
Improvements ✅
(secondary)
-0.2% [-0.3%, -0.2%] 4
All ❌✅ (primary) -0.1% [-0.6%, 0.2%] 82

Bootstrap: 671.34s -> 672.049s (0.11%)
Artifact size: 315.76 MiB -> 315.66 MiB (-0.03%)

@m-ou-se m-ou-se removed the beta-nominated Nominated for backporting to the compiler in the beta channel. label Apr 3, 2024
@m-ou-se
Copy link
Member

m-ou-se commented Apr 3, 2024

We briefly discussed this in the libs meeting, but it didn't seem worth backporting considering the small performance impact.

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. perf-regression Performance regression. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

10 participants