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

Rollup of 8 pull requests #122256

Merged
merged 23 commits into from
Mar 9, 2024
Merged

Rollup of 8 pull requests #122256

merged 23 commits into from
Mar 9, 2024

Conversation

Nadrieril
Copy link
Member

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

Dajamante and others added 23 commits July 11, 2022 13:12
Signed-off-by: onur-ozkan <work@onurozkan.dev>
Code changes in raw_vec require blessing UI tests every time
ACP: rust-lang/libs-team#156

Signed-off-by: Andrew Wock <ajwock@gmail.com>
still depend on 0.11:
* clippy
* rustfmt, sigh
Make `impl<Fd: AsFd>` impl take `?Sized`

`@rustbot` labels: +T-libs-api +needs-fcp
…nieu

Vec::try_with_capacity

Related to rust-lang#91913

Implements try_with_capacity for `Vec`, `VecDeque`, and `String`. I can follow it up with more collections if desired.

`Vec::try_with_capacity()` is functionally equivalent to the current stable:

```rust
let mut v = Vec::new();
v.try_reserve_exact(n)?
```

However, `try_reserve` calls non-inlined `finish_grow`, which requires old and new `Layout`, and is designed to reallocate memory. There is benefit to using `try_with_capacity`, besides syntax convenience, because it generates much smaller code at the call site with a direct call to the allocator. There's codegen test included.

It's also a very desirable functionality for users of `no_global_oom_handling` (Rust-for-Linux), since it makes a very commonly used function available in that environment (`with_capacity` is used much more frequently than all `(try_)reserve(_exact)`).
impl From<TryReserveError> for io::Error

There's an obvious mapping between these two errors, and it makes I/O code less noisy.

I've chosen to use simple `ErrorKind::OutOfMemory` `io::Error`, without keeping `TryReserveError` for the `source()`, because:

* It matches current uses in libstd,
* `ErrorData::Custom` allocates, which is a risky proposition for handling OOM errors specifically.
* Currently `TryReserveError` has no public fields/methods, so it's usefulness is limited. How allocators should report errors, especially custom and verbose ones is still an open question.

Just in case I've added note in the doccomment that this may change.

The compiler forced me to declare stability of this impl. I think this implementation is simple enough that it doesn't need full-blown stabilization period, and I've marked it for the next release, but of course I can adjust the attribute if needed.
…rk-Simulacrum

on the fly type casting for `build.rustc` and `build.cargo`

self-explanatory
…crum

bump itertools to 0.12

still depend on 0.11 (temporary dupes version):
* <del>clippy</del>, rust-lang/rust-clippy#12346
* rustfmt, sigh, rust-lang/rustfmt#6093

https://github.com/rust-itertools/itertools/blob/v0.12.1/CHANGELOG.md

removed unused `derive_more` dep from `rustc_middle`
…acrum

Implement junction_point

Implements rust-lang#121709

We already had a private implementation that we use for tests so we could just make that public. Except it was very hacky as it was only ever intended for use in testing. I've made an improved version that at least handles path conversion correctly and has less need for things like the `Align8` hack. There's still room for further improvement though.
@rustbot rustbot added A-testsuite Area: The testsuite used to check the correctness of rustc O-windows Operating system: Windows S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) 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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Mar 9, 2024
@Nadrieril
Copy link
Member Author

@bors r+ rollup=never p=5

@rustbot rustbot added the rollup A PR which is a rollup label Mar 9, 2024
@bors
Copy link
Contributor

bors commented Mar 9, 2024

📌 Commit 13ca978 has been approved by Nadrieril

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

bors commented Mar 9, 2024

⌛ Testing commit 13ca978 with merge 2d24fe5...

@bors
Copy link
Contributor

bors commented Mar 9, 2024

☀️ Test successful - checks-actions
Approved by: Nadrieril
Pushing 2d24fe5 to master...

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

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#99153 Add Read Impl for &Stdin a0a33c7a4e144044de98362543339584636817a9 (link)
#114655 Make impl<Fd: AsFd> impl take ?Sized 3770492063efd8e1844cbbb50d1b76dc2f0d4f9c (link)
#120504 Vec::try_with_capacity 1e682dbcfc2fc21dab21501483c231ad8acb0487 (link)
#121280 Implement MaybeUninit::fill{,_with,_from} b8f9fdffe434afc24b0c1f30a4566dc7e9910e2c (link)
#121403 impl From for io::Error 8d35fdaa0fefdda9c5d3d68c2f68e7fe24d0a876 (link)
#121526 on the fly type casting for build.rustc and build.cargo bb9020eab93644d98e72d1c9c666f07a17c8e493 (link)
#121584 bump itertools to 0.12 c50800ff948707ecd88d6b94c155ec50923eb8a6 (link)
#121711 Implement junction_point 07b7f16468f9b206d723062e87512d1b0ca886f4 (link)

previous master: 25ee3c6a2f

In the case of a perf regression, run the following command for each PR you suspect might be the cause: @rust-timer build $SHA

@Nadrieril Nadrieril deleted the rollup-rc232xh branch March 9, 2024 23:52
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (2d24fe5): 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.2%, 1.6%] 21
Regressions ❌
(secondary)
0.6% [0.3%, 1.6%] 7
Improvements ✅
(primary)
-0.7% [-1.0%, -0.5%] 3
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.4% [-1.0%, 1.6%] 24

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.6% [0.4%, 7.3%] 7
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-5.4% [-8.6%, -2.8%] 4
Improvements ✅
(secondary)
-3.4% [-4.1%, -2.8%] 6
All ❌✅ (primary) 0.3% [-8.6%, 7.3%] 11

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)
1.2% [0.8%, 1.5%] 3
Regressions ❌
(secondary)
1.3% [1.1%, 1.5%] 4
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.2% [0.8%, 1.5%] 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.5% [0.1%, 1.1%] 59
Regressions ❌
(secondary)
0.3% [0.2%, 0.5%] 5
Improvements ✅
(primary)
-0.4% [-1.3%, -0.1%] 9
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.4% [-1.3%, 1.1%] 68

Bootstrap: 647.693s -> 647.204s (-0.08%)
Artifact size: 310.09 MiB -> 310.08 MiB (-0.00%)

@rustbot rustbot added the perf-regression Performance regression. label Mar 10, 2024
@Nadrieril
Copy link
Member Author

Nadrieril commented Mar 10, 2024

Could it be #121584 bump itertools to 0.12?

@rust-timer build c50800f

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (c50800f): comparison URL.

Overall result: ❌ regressions - no action needed

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

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

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

Binary size

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

Bootstrap: 647.693s -> 646.556s (-0.18%)
Artifact size: 310.09 MiB -> 310.09 MiB (-0.00%)

@Nadrieril
Copy link
Member Author

Could it be #120504 Vec::try_with_capacity

@rust-timer build 1e682db

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (1e682db): comparison URL.

Overall result: ❌✅ regressions and improvements - ACTION NEEDED

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.2%, 1.6%] 24
Regressions ❌
(secondary)
0.4% [0.3%, 0.5%] 6
Improvements ✅
(primary)
-0.8% [-1.6%, -0.4%] 4
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.4% [-1.6%, 1.6%] 28

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.1% [0.4%, 7.8%] 6
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-6.0% [-8.8%, -3.9%] 3
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.1% [-8.8%, 7.8%] 9

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)
1.6% [1.6%, 1.6%] 1
Regressions ❌
(secondary)
1.3% [1.1%, 1.5%] 3
Improvements ✅
(primary)
-1.6% [-1.6%, -1.6%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.0% [-1.6%, 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.1%, 1.1%] 59
Regressions ❌
(secondary)
0.3% [0.2%, 0.5%] 5
Improvements ✅
(primary)
-0.4% [-1.4%, -0.1%] 10
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.4% [-1.4%, 1.1%] 69

Bootstrap: 647.693s -> 648.543s (0.13%)
Artifact size: 310.09 MiB -> 310.01 MiB (-0.02%)

@Nadrieril Nadrieril added the perf-regression-triaged The performance regression has been triaged. label Mar 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc merged-by-bors This PR was explicitly merged by bors. O-windows Operating system: Windows perf-regression Performance regression. perf-regression-triaged The performance regression has been triaged. rollup A PR which is a rollup S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) 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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.