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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants