-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Add #[track_caller]
to allocating methods of Vec
& VecDeque
#126557
Conversation
This comment has been minimized.
This comment has been minimized.
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
Add `#[track_caller]` to allocating methods of `Vec` & `VecDeque` Part 4 in a lengthy saga. r? `@joshtriplett` because they were the reviewer the last 3 times. `@bors` rollup=never "[just in case this has perf effects, Vec is hot](rust-lang#79323 (comment))" This was first attempted in rust-lang#79323 by `@nvzqz.` It got approval from `@joshtriplett,` but rotted with merge conflicts and got closed. Then it got picked up by `@Dylan-DPC-zz` in rust-lang#83359. A benchmark was run[^perf], the results (after a bit of thinking[^thinking]) were deemed ok[^ok], but there was a typo[^typo] and the PR was made from a wrong remote in the first place[^remote], so rust-lang#83909 was opened instead. By the time rust-lang#83909 rolled around, the methods in question had received some optimizations[^optimizations], so another perf run was conducted[^perf2]. The results were ok[^ok2]. There was a suggestion to add regression tests for panic behavior [^tests], but before it could be addressed, the PR fell victim to merge conflicts[^conflicts] and died again[^rip]. 3 years have passed, and (from what I can tell) this has not been tried again, so here I am now, reviving this old effort. Given how much time has passed and the fact that I've also touched `VecDeque` this time, it probably makes sense to `@bors` try `@rust-timer` [^perf]: rust-lang#83359 (comment) [^thinking]: rust-lang#83359 (comment) [^ok]: rust-lang#83359 (comment) [^typo]: rust-lang#83359 (comment) [^remote]: rust-lang#83359 (comment) [^optimizations]: rust-lang#83909 (comment) [^perf2]: rust-lang#83909 (comment) [^ok2]: rust-lang#83909 (comment) [^tests]: rust-lang#83909 (comment) [^conflicts]: rust-lang#83909 (comment) [^rip]: rust-lang#83909 (comment)
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (579ad25): comparison URL. Overall result: ❌✅ regressions and improvements - ACTION NEEDEDBenchmarking 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. Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @bors rollup=never Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)Results (primary -2.4%, secondary -0.5%)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.
CyclesResults (primary -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.
Binary sizeResults (primary 0.5%, secondary 1.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.
Bootstrap: 671.558s -> 672.209s (0.10%) |
r? libs |
The failing test is for #70963. While blessing it would be trivial, diff --git c/tests/ui/hygiene/panic-location.run.stderr i/tests/ui/hygiene/panic-location.run.stderr
index 5c1778bc485..b9086ecef81 100644
--- c/tests/ui/hygiene/panic-location.run.stderr
+++ i/tests/ui/hygiene/panic-location.run.stderr
@@ -1,3 +1,3 @@
-thread 'main' panicked at library/alloc/src/raw_vec.rs:LL:CC:
+thread 'main' panicked at $DIR/panic-location.rs:LL:CC:
capacity overflow
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace I am not sure it would still test the thing it is supposed to test. A minor nitpick, but the comment rust/tests/ui/hygiene/panic-location.rs Lines 7 to 8 in 5451c6d
|
5451c6d
to
90d80a9
Compare
I've rebased on top of master, blessed the test, and change its comment a bit. Might be worth to do another perf run? r? libs |
Sure! |
This comment has been minimized.
This comment has been minimized.
Add `#[track_caller]` to allocating methods of `Vec` & `VecDeque` Part 4 in a lengthy saga. r? `@joshtriplett` because they were the reviewer the last 3 times. `@bors` rollup=never "[just in case this has perf effects, Vec is hot](rust-lang#79323 (comment))" This was first attempted in rust-lang#79323 by `@nvzqz.` It got approval from `@joshtriplett,` but rotted with merge conflicts and got closed. Then it got picked up by `@Dylan-DPC-zz` in rust-lang#83359. A benchmark was run[^perf], the results (after a bit of thinking[^thinking]) were deemed ok[^ok], but there was a typo[^typo] and the PR was made from a wrong remote in the first place[^remote], so rust-lang#83909 was opened instead. By the time rust-lang#83909 rolled around, the methods in question had received some optimizations[^optimizations], so another perf run was conducted[^perf2]. The results were ok[^ok2]. There was a suggestion to add regression tests for panic behavior [^tests], but before it could be addressed, the PR fell victim to merge conflicts[^conflicts] and died again[^rip]. 3 years have passed, and (from what I can tell) this has not been tried again, so here I am now, reviving this old effort. Given how much time has passed and the fact that I've also touched `VecDeque` this time, it probably makes sense to `@bors` try `@rust-timer` [^perf]: rust-lang#83359 (comment) [^thinking]: rust-lang#83359 (comment) [^ok]: rust-lang#83359 (comment) [^typo]: rust-lang#83359 (comment) [^remote]: rust-lang#83359 (comment) [^optimizations]: rust-lang#83909 (comment) [^perf2]: rust-lang#83909 (comment) [^ok2]: rust-lang#83909 (comment) [^tests]: rust-lang#83909 (comment) [^conflicts]: rust-lang#83909 (comment) [^rip]: rust-lang#83909 (comment)
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (bf493f5): comparison URL. Overall result: ❌ regressions - ACTION NEEDEDBenchmarking 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. Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @bors rollup=never Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)Results (primary 1.2%, secondary 2.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.
CyclesResults (primary 3.1%, secondary 4.9%)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.
Binary sizeResults (primary 0.5%, secondary 1.1%)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.
Bootstrap: 750.629s -> 753.884s (0.43%) |
As pointed out in rust-lang#126557 (comment) Co-authored-by: Jonas Böttiger <jonasboettiger@icloud.com>
I don't really have ideas for improving this, but it makes sense to me as a feature, so I'm nominating this for T-libs discussion to see whether they'd be OK with taking the slight performance hit associated with this. @rustbot label +I-libs-nominated |
☔ The latest upstream changes (presumably #129063) made this pull request unmergeable. Please resolve the merge conflicts. |
We discussed this in today's @rust-lang/libs meeting. We're going to approve this, on the expectation that it won't have appreciable runtime performance overhead. If this does turn out to have appreciable runtime performance overhead, we want to re-evaluate this and consider reverting. |
Let me do a rebase and resolve the conflicts then |
848a645
to
2363faa
Compare
As pointed out in rust-lang#126557 (comment) Co-authored-by: Jonas Böttiger <jonasboettiger@icloud.com>
☔ The latest upstream changes (presumably #130572) made this pull request unmergeable. Please resolve the merge conflicts. |
2363faa
to
683ef60
Compare
Ship it 🚀! |
☀️ Test successful - checks-actions |
Finished benchmarking commit (f6648f2): comparison URL. Overall result: ❌✅ regressions and improvements - please read the text belowOur benchmarks found a performance regression caused by this PR. Next Steps:
@rustbot label: +perf-regression Instruction countThis 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.
Max RSS (memory usage)Results (primary -3.1%)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.
CyclesResults (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.
Binary sizeResults (primary 0.5%, secondary 1.1%)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.
Bootstrap: 782.102s -> 782.104s (0.00%) |
Ouch on the binary size increases :/ |
Kind of expected. The applications/libraries suffering the most are going to be the ones with the most instantiations of If anything, it would be more useful to know which kind of allocation failed, i.e. the size of the allocation and the type that was supposed to go into it than the caller. |
Visiting for weekly perf triage.
@rustbot label: +perf-regression-triaged |
@rustbot label +I-libs-nominated just nominating to double check if T-libs count the binary size increases as potential evidence of "runtime regression" as referenced in their earlier comment: #126557 (comment) |
Part 4 in a lengthy saga.
r? @joshtriplett because they were the reviewer the last 3 times.
@bors rollup=never "just in case this has perf effects, Vec is hot"
This was first attempted in #79323 by @nvzqz. It got approval from @joshtriplett, but rotted with merge conflicts and got closed.
Then it got picked up by @Dylan-DPC-zz in #83359. A benchmark was run1, the results (after a bit of thinking2) were deemed ok3, but there was a typo4 and the PR was made from a wrong remote in the first place5, so #83909 was opened instead.
By the time #83909 rolled around, the methods in question had received some optimizations6, so another perf run was conducted7. The results were ok8. There was a suggestion to add regression tests for panic behavior 9, but before it could be addressed, the PR fell victim to merge conflicts10 and died again11.
3 years have passed, and (from what I can tell) this has not been tried again, so here I am now, reviving this old effort.
Given how much time has passed and the fact that I've also touched
VecDeque
this time, it probably makes sense to@bors try @rust-timer
Footnotes
https://github.com/rust-lang/rust/pull/83359#issuecomment-804450095 ↩
https://github.com/rust-lang/rust/pull/83359#issuecomment-805286704 ↩
https://github.com/rust-lang/rust/pull/83359#issuecomment-812739031 ↩
https://github.com/rust-lang/rust/pull/83359#issuecomment-812750205 ↩
https://github.com/rust-lang/rust/pull/83359#issuecomment-814067119 ↩
https://github.com/rust-lang/rust/pull/83909#issuecomment-813736593 ↩
https://github.com/rust-lang/rust/pull/83909#issuecomment-813825552 ↩
https://github.com/rust-lang/rust/pull/83909#issuecomment-813831341 ↩
https://github.com/rust-lang/rust/pull/83909#issuecomment-825788964 ↩
https://github.com/rust-lang/rust/pull/83909#issuecomment-851173480 ↩
https://github.com/rust-lang/rust/pull/83909#issuecomment-873569771 ↩