Skip to content

Introduce Arena::try_alloc_from_iter. #140023

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

Merged
merged 1 commit into from
Apr 30, 2025
Merged

Conversation

cjgillot
Copy link
Contributor

@cjgillot cjgillot commented Apr 19, 2025

alloc_from_iter already collects the iterator for reentrancy. So adding an early exit for a fallible iterator integrates naturally into the code. This avoids the other solution to allocate and dump the allocation.

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Apr 19, 2025
@rustbot
Copy link
Collaborator

rustbot commented Apr 19, 2025

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

@cjgillot
Copy link
Contributor Author

@bors try @rustc-timer queue

bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 19, 2025
Introduce Arena::try_alloc_from_iter.

r? `@ghost` for perf
@bors
Copy link
Collaborator

bors commented Apr 19, 2025

⌛ Trying commit d0d3021 with merge b52d335...

@bors
Copy link
Collaborator

bors commented Apr 19, 2025

☀️ Try build successful - checks-actions
Build commit: b52d335 (b52d3352518a7502ce32354b94ec6cf8b5855fee)

@oli-obk
Copy link
Contributor

oli-obk commented Apr 19, 2025

@rust-timer build b52d335

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (b52d335): comparison URL.

Overall result: no relevant changes - 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 benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results (primary 0.7%, secondary 1.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)
0.8% [0.4%, 1.9%] 9
Regressions ❌
(secondary)
2.5% [2.2%, 2.8%] 2
Improvements ✅
(primary)
-0.9% [-0.9%, -0.9%] 1
Improvements ✅
(secondary)
-2.0% [-2.0%, -2.0%] 1
All ❌✅ (primary) 0.7% [-0.9%, 1.9%] 10

Cycles

Results (primary -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.5% [0.5%, 0.5%] 2
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.6% [-1.0%, -0.4%] 5
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.3% [-1.0%, 0.5%] 7

Binary size

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

Bootstrap: 772.31s -> 773.339s (0.13%)
Artifact size: 365.02 MiB -> 365.05 MiB (0.01%)

@cjgillot
Copy link
Contributor Author

r? compiler

@BoxyUwU
Copy link
Member

BoxyUwU commented Apr 28, 2025

@bors r+

@bors
Copy link
Collaborator

bors commented Apr 28, 2025

📌 Commit d0d3021 has been approved by BoxyUwU

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 Apr 28, 2025
@bors
Copy link
Collaborator

bors commented Apr 29, 2025

⌛ Testing commit d0d3021 with merge 0fbb922...

@bors
Copy link
Collaborator

bors commented Apr 30, 2025

☀️ Test successful - checks-actions
Approved by: BoxyUwU
Pushing 0fbb922 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Apr 30, 2025
@bors bors merged commit 0fbb922 into rust-lang:master Apr 30, 2025
7 checks passed
@rustbot rustbot added this to the 1.88.0 milestone Apr 30, 2025
Copy link

What is this? This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.

Comparing 7450913 (parent) -> 0fbb922 (this PR)

Test differences

No test diffs found

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard 0fbb922e530399599aab8296ea975cb9e7ed67bf --output-dir test-dashboard

And then open test-dashboard/index.html in your browser to see an overview of all executed tests.

Job duration changes

  1. dist-arm-linux: 6596.1s -> 4550.9s (-31.0%)
  2. x86_64-apple-1: 6751.0s -> 8448.5s (25.1%)
  3. dist-powerpc-linux: 6231.7s -> 5210.9s (-16.4%)
  4. x86_64-gnu-distcheck: 4955.6s -> 4380.6s (-11.6%)
  5. dist-x86_64-apple: 9580.9s -> 8516.1s (-11.1%)
  6. x86_64-gnu-llvm-19-1: 5277.1s -> 5657.9s (7.2%)
  7. armhf-gnu: 4778.1s -> 4437.6s (-7.1%)
  8. x86_64-apple-2: 4729.7s -> 5064.3s (7.1%)
  9. dist-aarch64-apple: 5530.6s -> 5159.2s (-6.7%)
  10. x86_64-msvc-2: 6740.9s -> 7173.3s (6.4%)
How to interpret the job duration changes?

Job durations can vary a lot, based on the actual runner instance
that executed the job, system noise, invalidated caches, etc. The table above is provided
mostly for t-infra members, for simpler debugging of potential CI slow-downs.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (0fbb922): comparison URL.

Overall result: ❌ regressions - please read the text below

Our benchmarks found a performance regression caused by this PR.
This might be an actual regression, but it can also be just noise.

Next Steps:

  • If the regression was expected or you think it can be justified,
    please write a comment with sufficient written justification, and add
    @rustbot label: +perf-regression-triaged to it, to mark the regression as triaged.
  • If you think that you know of a way to resolve the regression, try to create
    a new PR with a fix for the regression.
  • If you do not understand the regression or you think that it is just noise,
    you can ask the @rust-lang/wg-compiler-performance working group for help (members of this group
    were already notified of this PR).

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

Instruction count

This is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.

mean range count
Regressions ❌
(primary)
0.3% [0.3%, 0.4%] 3
Regressions ❌
(secondary)
0.3% [0.1%, 0.4%] 15
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.3% [0.3%, 0.4%] 3

Max RSS (memory usage)

Results (primary 0.1%, secondary 1.4%)

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.9% [0.4%, 2.8%] 7
Regressions ❌
(secondary)
5.9% [2.3%, 9.5%] 2
Improvements ✅
(primary)
-1.1% [-2.7%, -0.6%] 5
Improvements ✅
(secondary)
-3.1% [-3.7%, -2.4%] 2
All ❌✅ (primary) 0.1% [-2.7%, 2.8%] 12

Cycles

Results (primary 0.6%, secondary -2.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)
0.6% [0.4%, 0.8%] 4
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.2% [-2.2%, -2.2%] 1
All ❌✅ (primary) 0.6% [0.4%, 0.8%] 4

Binary size

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

Bootstrap: 766.94s -> 769.061s (0.28%)
Artifact size: 365.61 MiB -> 365.55 MiB (-0.02%)

@rustbot rustbot added the perf-regression Performance regression. label Apr 30, 2025
@Mark-Simulacrum Mark-Simulacrum added the perf-regression-triaged The performance regression has been triaged. label May 5, 2025
@Mark-Simulacrum
Copy link
Member

Regressions look plausibly real (they've held up for a bit) but given they're small and limited to just doc builds I'm inclined to accept. It seems plausible this is just some slight differences in the ABI of the functions here or similar...

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. 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-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants