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

BTreeMap: Support custom allocators (v1.5) #98103

Merged
merged 3 commits into from
Jun 16, 2022
Merged

Conversation

exrook
Copy link
Contributor

@exrook exrook commented Jun 14, 2022

@rust-highfive
Copy link
Collaborator

Hey! It looks like you've submitted a new PR for the library teams!

If this PR contains changes to any rust-lang/rust public library APIs then please comment with @rustbot label +T-libs-api -T-libs to tag it appropriately. If this PR contains changes to any unstable APIs please edit the PR description to add a link to the relevant API Change Proposal or create one if you haven't already. If you're unsure where your change falls no worries, just leave it as is and the reviewer will take a look and make a decision to forward on if necessary.

Examples of T-libs-api changes:

  • Stabilizing library features
  • Introducing insta-stable changes such as new implementations of existing stable traits on existing stable types
  • Introducing new or changing existing unstable library APIs (excluding permanently unstable features / features without a tracking issue)
  • Changing public documentation in ways that create new stability guarantees
  • Changing observable runtime behavior of library APIs

@rustbot rustbot added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jun 14, 2022
@rust-highfive
Copy link
Collaborator

r? @m-ou-se

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 14, 2022
@exrook
Copy link
Contributor Author

exrook commented Jun 14, 2022

r? @Amanieu

@rust-highfive rust-highfive assigned Amanieu and unassigned m-ou-se Jun 14, 2022
@exrook
Copy link
Contributor Author

exrook commented Jun 14, 2022

@rustbot modify labels: +A-allocators +T-libs-api -T-compiler -T-libs

@rustbot rustbot added A-allocators Area: Custom and system allocators T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. and removed T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jun 14, 2022
@Amanieu
Copy link
Member

Amanieu commented Jun 14, 2022

@bors r+

@bors
Copy link
Contributor

bors commented Jun 14, 2022

📌 Commit 1f7023a has been approved by Amanieu

@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 Jun 14, 2022
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Jun 15, 2022
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Jun 15, 2022
@bors
Copy link
Contributor

bors commented Jun 16, 2022

⌛ Testing commit 1f7023a with merge 1b9daa6...

@bors
Copy link
Contributor

bors commented Jun 16, 2022

☀️ Test successful - checks-actions
Approved by: Amanieu
Pushing 1b9daa6 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jun 16, 2022
@bors bors merged commit 1b9daa6 into rust-lang:master Jun 16, 2022
@rustbot rustbot added this to the 1.63.0 milestone Jun 16, 2022
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (1b9daa6): comparison url.

Instruction count

  • Primary benchmarks: 😿 relevant regressions found
  • Secondary benchmarks: 😿 relevant regressions found
mean1 max count2
Regressions 😿
(primary)
1.7% 3.0% 2
Regressions 😿
(secondary)
1.6% 2.1% 6
Improvements 🎉
(primary)
N/A N/A 0
Improvements 🎉
(secondary)
N/A N/A 0
All 😿🎉 (primary) 1.7% 3.0% 2

Max RSS (memory usage)

Results
  • Primary benchmarks: mixed results
  • Secondary benchmarks: 😿 relevant regression found
mean1 max count2
Regressions 😿
(primary)
0.2% 0.2% 1
Regressions 😿
(secondary)
4.6% 4.6% 1
Improvements 🎉
(primary)
-2.2% -2.2% 1
Improvements 🎉
(secondary)
N/A N/A 0
All 😿🎉 (primary) -1.0% -2.2% 2

Cycles

Results
  • Primary benchmarks: 😿 relevant regressions found
  • Secondary benchmarks: no relevant changes found
mean1 max count2
Regressions 😿
(primary)
3.5% 4.1% 2
Regressions 😿
(secondary)
N/A N/A 0
Improvements 🎉
(primary)
N/A N/A 0
Improvements 🎉
(secondary)
N/A N/A 0
All 😿🎉 (primary) 3.5% 4.1% 2

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

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

Footnotes

  1. the arithmetic mean of the percent change 2 3

  2. number of relevant changes 2 3

@rustbot rustbot added the perf-regression Performance regression. label Jun 16, 2022
@RalfJung
Copy link
Member

This introduced an ICE in Miri: #98176. The actual bug is probably somewhere else and just uncovered here. But the strange thing is that the ICE does not need custom allocators to be triggered.

@RalfJung
Copy link
Member

FWIW that might be related to the performance regressions -- this PR will create Box<T, &System> boxes, which are twice as big as regular Box<T> boxes.

@TennyZhuang
Copy link
Contributor

FWIW that might be related to the performance regressions -- this PR will create Box<T, &System> boxes, which are twice as big as regular Box<T> boxes.

I guess that this can be fixed by replacing Box<T, &A> to Box<T, A>, and I'd like to submit a PR to fix this!

@TennyZhuang
Copy link
Contributor

It's unavoidable to change all A: Allocator to A: Allocator + Clone, is it acceptable? It seems that hashbrown does the same thing.

@RalfJung
Copy link
Member

I'm already working on that in #98178 -- sorry.

phil-opp added a commit to rust-osdev/cargo-xbuild that referenced this pull request Jun 21, 2022
The alloc library was switched to the 2021 edition in <rust-lang/rust#92068>. However, it did not use any features of the new edition until PR <rust-lang/rust#98103>, which relies on the newer closure capture mechanism. This commit fixes the build on the latest nightlies, which include that PR.

Fixes #104
@Mark-Simulacrum Mark-Simulacrum added the perf-regression-triaged The performance regression has been triaged. label Jun 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-allocators Area: Custom and system allocators merged-by-bors This PR was explicitly merged by bors. perf-regression Performance regression. perf-regression-triaged The performance regression has been triaged. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs-api Relevant to the library API 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

10 participants