Skip to content

Conversation

@Noratrieb
Copy link
Member

@Noratrieb Noratrieb commented Sep 25, 2025

They cause significant binary size overhead while contributing little value.

closes #146963, see that issue for more details.

@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 Sep 25, 2025
@rustbot
Copy link
Collaborator

rustbot commented Sep 25, 2025

r? @tgross35

rustbot has assigned @tgross35.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@tgross35
Copy link
Contributor

Let's get a metric,

@bors2 try @rust-timer queue

I think it would be worth a comment somewhere in the vec module about the downsides here because it seems likely to eventually come up again.

@rust-timer

This comment has been minimized.

rust-bors bot added a commit that referenced this pull request Sep 25, 2025
Remove most `#[track_caller]` from allocating Vec methods
@rust-bors

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Sep 25, 2025
@Noratrieb
Copy link
Member Author

I've also reverted the part of #142728 that were related to allocation (and kept those related to normal panics).

They cause significant binary size overhead while contributing little
value.

Also removes them from the wrapping String methods that do not panic.
@rust-bors
Copy link

rust-bors bot commented Sep 25, 2025

☀️ Try build successful (CI)
Build commit: 53ff5a2 (53ff5a255756389b9bcba2fae16159745144eb13, parent: 6f34f4ee074ce0affc7bbf4e2c835f66cd576f13)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (53ff5a2): comparison URL.

Overall result: ✅ improvements - no action needed

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

@bors rollup=never
@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

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

Max RSS (memory usage)

Results (primary 3.0%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
7.5% [7.5%, 7.5%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-1.6% [-1.6%, -1.6%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 3.0% [-1.6%, 7.5%] 2

Cycles

Results (primary -2.5%, secondary 0.6%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
2.7% [2.7%, 2.7%] 1
Improvements ✅
(primary)
-2.5% [-2.5%, -2.5%] 1
Improvements ✅
(secondary)
-1.5% [-1.5%, -1.5%] 1
All ❌✅ (primary) -2.5% [-2.5%, -2.5%] 1

Binary size

Results (primary -0.4%, secondary -0.8%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.4% [-1.0%, -0.0%] 95
Improvements ✅
(secondary)
-0.8% [-1.4%, -0.0%] 56
All ❌✅ (primary) -0.4% [-1.0%, -0.0%] 95

Bootstrap: 471.619s -> 469.77s (-0.39%)
Artifact size: 388.14 MiB -> 387.68 MiB (-0.12%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Sep 26, 2025
@tgross35
Copy link
Contributor

Well that’s about the easiest set of wins we’ve had in a while 🎉. One note here is that the extend impls effectively take a callback, so I think this would give a less accurate panic location if the Iterator panics? Doesn’t seem concerning to me, that should basically never happen.

I still think it wouldn’t hurt to add a comment somewhere in vec/mod.rs to help ward off potential future contributions adding this back without knowing the history here. r=me after that

@Noratrieb
Copy link
Member Author

Noratrieb commented Sep 26, 2025

I'm not sure anyone would find such a comment any more than they would find this PR. rustc-perf would certainly present a barrier, and I can surely hope that the next time there is more attention to the feature actually doing what people want 😨

@tgross35
Copy link
Contributor

Fair enough,
@bors r+

@bors
Copy link
Collaborator

bors commented Sep 26, 2025

📌 Commit 9316d45 has been approved by tgross35

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 Sep 26, 2025
@Zalathar
Copy link
Contributor

Scheduling: Bumping some rollup=never PRs so they get a fair chance to compete with rollups.

@bors p=5

@bors
Copy link
Collaborator

bors commented Sep 28, 2025

⌛ Testing commit 9316d45 with merge c7f6aa2...

@bors
Copy link
Collaborator

bors commented Sep 28, 2025

☀️ Test successful - checks-actions
Approved by: tgross35
Pushing c7f6aa2 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Sep 28, 2025
@bors bors merged commit c7f6aa2 into rust-lang:master Sep 28, 2025
11 checks passed
@rustbot rustbot added this to the 1.92.0 milestone Sep 28, 2025
@github-actions
Copy link
Contributor

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 848e674 (parent) -> c7f6aa2 (this PR)

Test differences

Show 834 test diffs

834 doctest diffs were found. These are ignored, as they are noisy.

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard c7f6aa2869acdbf014d094c6e427e554e160b6db --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-aarch64-linux: 6326.2s -> 8654.2s (36.8%)
  2. dist-apple-various: 4821.2s -> 3523.4s (-26.9%)
  3. arm-android: 5311.7s -> 6169.6s (16.2%)
  4. x86_64-gnu-llvm-20: 2519.8s -> 2856.8s (13.4%)
  5. x86_64-rust-for-linux: 2587.1s -> 2876.6s (11.2%)
  6. aarch64-apple: 4655.1s -> 5128.9s (10.2%)
  7. test-various: 4427.5s -> 4854.9s (9.7%)
  8. i686-gnu-nopt-1: 7323.9s -> 7990.2s (9.1%)
  9. dist-various-1: 4141.2s -> 3771.9s (-8.9%)
  10. i686-gnu-1: 7772.6s -> 8434.3s (8.5%)
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 (c7f6aa2): comparison URL.

Overall result: ✅ improvements - no action needed

@rustbot label: -perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
0.9% [0.9%, 0.9%] 1
Regressions ❌
(secondary)
0.3% [0.2%, 0.4%] 4
Improvements ✅
(primary)
-0.3% [-0.7%, -0.1%] 37
Improvements ✅
(secondary)
-0.3% [-0.5%, -0.0%] 26
All ❌✅ (primary) -0.3% [-0.7%, 0.9%] 38

Max RSS (memory usage)

Results (primary -1.8%, secondary -3.1%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-1.8% [-3.7%, -0.5%] 5
Improvements ✅
(secondary)
-3.1% [-3.1%, -3.1%] 1
All ❌✅ (primary) -1.8% [-3.7%, -0.5%] 5

Cycles

Results (primary 2.7%, secondary 3.0%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
2.7% [2.4%, 2.9%] 2
Regressions ❌
(secondary)
3.0% [3.0%, 3.0%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 2.7% [2.4%, 2.9%] 2

Binary size

Results (primary -0.4%, secondary -0.9%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.4% [-1.3%, -0.0%] 104
Improvements ✅
(secondary)
-0.9% [-1.4%, -0.1%] 56
All ❌✅ (primary) -0.4% [-1.3%, -0.0%] 104

Bootstrap: 471.059s -> 470.617s (-0.09%)
Artifact size: 388.15 MiB -> 387.65 MiB (-0.13%)

@Noratrieb Noratrieb deleted the untrack-caller-vec branch September 28, 2025 08:48
github-actions bot pushed a commit to model-checking/verify-rust-std that referenced this pull request Oct 9, 2025
…ss35

Remove most `#[track_caller]` from allocating Vec methods

They cause significant binary size overhead while contributing little value.

closes rust-lang#146963, see that issue for more details.
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. 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.

Vec allocation #[track_caller] should be removed

6 participants