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

Remove len argument from RawVec::reserve_for_push #122976

Merged
merged 4 commits into from Mar 30, 2024

Conversation

caibear
Copy link
Contributor

@caibear caibear commented Mar 24, 2024

Removes RawVec::reserve_for_push's len argument since it's always the same as capacity.
Also makes Vec::insert use RawVec::reserve_for_push.

@rustbot
Copy link
Collaborator

rustbot commented Mar 24, 2024

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @cuviper (or someone else) some time within the next two weeks.

Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (S-waiting-on-review and S-waiting-on-author) stays updated, invoking these commands when appropriate:

  • @rustbot author: the review is finished, PR author should check the comments and take action accordingly
  • @rustbot review: the author is ready for a review, this PR will be queued again in the reviewer's queue

@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 24, 2024
@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Mar 27, 2024

☔ The latest upstream changes (presumably #122396) made this pull request unmergeable. Please resolve the merge conflicts.

@cuviper
Copy link
Member

cuviper commented Mar 28, 2024

Also makes Vec::insert use RawVec::reserve_for_push.

Maybe we should rename to reserve_one?

Anyway, this needs a rebase after #122396.
@rustbot author

@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 28, 2024
@caibear
Copy link
Contributor Author

caibear commented Mar 28, 2024

Maybe we should rename to reserve_one?

reserve_one sounds like an specialized version of reserve(1). Unlike reserve(1), it always grows. I think a name like grow_one
more accurately represents it.

@rustbot rustbot added A-meta Area: Issues about the rust-lang/rust repository. A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) A-testsuite Area: The testsuite used to check the correctness of rustc O-unix Operating system: Unix-like PG-exploit-mitigations Project group: Exploit mitigations T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. labels Mar 28, 2024
@rustbot

This comment was marked as outdated.

@rustbot rustbot added the has-merge-commits PR has merge commits, merge with caution. label Mar 28, 2024
@rustbot

This comment was marked as resolved.

… equal to capacity. Also make Vec::insert use reserve_for_push.
@rustbot rustbot removed the has-merge-commits PR has merge commits, merge with caution. label Mar 28, 2024
@caibear
Copy link
Contributor Author

caibear commented Mar 28, 2024

@rustbot review

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Mar 28, 2024
@cuviper cuviper removed A-testsuite Area: The testsuite used to check the correctness of rustc T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Mar 29, 2024
@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Mar 29, 2024
@cuviper
Copy link
Member

cuviper commented Mar 29, 2024

That looks fine to me!

@bors r+

@bors
Copy link
Contributor

bors commented Mar 29, 2024

📌 Commit aba592d has been approved by cuviper

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 29, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 29, 2024
…=cuviper

Remove len argument from RawVec::reserve_for_push

Removes `RawVec::reserve_for_push`'s `len` argument since it's always the same as capacity.
Also makes `Vec::insert` use `RawVec::reserve_for_push`.
@bors
Copy link
Contributor

bors commented Mar 29, 2024

⌛ Testing commit aba592d with merge ca8923a...

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Mar 29, 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 29, 2024
@cuviper
Copy link
Member

cuviper commented Mar 29, 2024

That's a legitimate failure, but it should be a straightforward update of the expected strings.
@rustbot author

@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 29, 2024
@caibear
Copy link
Contributor Author

caibear commented Mar 29, 2024

@rustbot review

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Mar 29, 2024
@cuviper
Copy link
Member

cuviper commented Mar 29, 2024

@bors r+

@bors
Copy link
Contributor

bors commented Mar 29, 2024

📌 Commit 4500c83 has been approved by cuviper

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

bors commented Mar 30, 2024

⌛ Testing commit 4500c83 with merge 877d36b...

@bors
Copy link
Contributor

bors commented Mar 30, 2024

☀️ Test successful - checks-actions
Approved by: cuviper
Pushing 877d36b to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Mar 30, 2024
@bors bors merged commit 877d36b into rust-lang:master Mar 30, 2024
12 checks passed
@rustbot rustbot added this to the 1.79.0 milestone Mar 30, 2024
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (877d36b): 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
Regressions ❌
(secondary)
2.8% [2.8%, 2.8%] 1
Improvements ✅
(primary)
-1.7% [-1.7%, -1.7%] 1
Improvements ✅
(secondary)
-0.4% [-0.4%, -0.3%] 5
All ❌✅ (primary) -1.7% [-1.7%, -1.7%] 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)
-2.8% [-3.6%, -1.9%] 2
Improvements ✅
(secondary)
-2.8% [-3.1%, -2.5%] 2
All ❌✅ (primary) -2.8% [-3.6%, -1.9%] 2

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)
2.1% [2.1%, 2.1%] 1
Improvements ✅
(primary)
-1.2% [-1.5%, -1.0%] 3
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -1.2% [-1.5%, -1.0%] 3

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.1%, 0.2%] 2
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.0% [-0.2%, -0.0%] 33
Improvements ✅
(secondary)
-0.0% [-0.2%, -0.0%] 38
All ❌✅ (primary) -0.0% [-0.2%, 0.2%] 35

Bootstrap: 668.236s -> 671.487s (0.49%)
Artifact size: 315.84 MiB -> 315.77 MiB (-0.02%)

@caibear caibear deleted the optimize_reserve_for_push branch March 30, 2024 07:39
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.

None yet

6 participants