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

Mark Vec::drop() as #[inline] #102554

Closed
wants to merge 2 commits into from
Closed

Conversation

nikic
Copy link
Contributor

@nikic nikic commented Oct 1, 2022

As seen in #102539 (comment), Vec::drop() is commonly a no-op, if the underlying type does not need drop. Checking to see what the impact of this would be, I'm not sure the change can be done in this form (an alternative would be to do a needs_drop check and only instantiate that part in each CGU).

r? @ghost

@rustbot
Copy link
Collaborator

rustbot commented Oct 1, 2022

Hey! It looks like you've submitted a new PR for the library teams!

If this PR contains changes to any rust-lang/rust public library APIs then please comment with @rustbot label +T-libs-api -T-libs to tag it appropriately. If this PR contains changes to any unstable APIs please edit the PR description to add a link to the relevant API Change Proposal or create one if you haven't already. If you're unsure where your change falls no worries, just leave it as is and the reviewer will take a look and make a decision to forward on if necessary.

Examples of T-libs-api changes:

  • Stabilizing library features
  • Introducing insta-stable changes such as new implementations of existing stable traits on existing stable types
  • Introducing new or changing existing unstable library APIs (excluding permanently unstable features / features without a tracking issue)
  • Changing public documentation in ways that create new stability guarantees
  • Changing observable runtime behavior of library APIs

@rustbot rustbot added the T-libs Relevant to the library team, which will review and decide on the PR/issue. label Oct 1, 2022
@nikic
Copy link
Contributor Author

nikic commented Oct 1, 2022

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

@rustbot label: +S-waiting-on-perf

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Oct 1, 2022
@bors
Copy link
Collaborator

bors commented Oct 1, 2022

⌛ Trying commit 0b66d5f with merge 0313714872a1265ca2e99812c4bd550ede699c36...

@bors
Copy link
Collaborator

bors commented Oct 1, 2022

☀️ Try build successful - checks-actions
Build commit: 0313714872a1265ca2e99812c4bd550ede699c36 (0313714872a1265ca2e99812c4bd550ede699c36)

@rust-timer
Copy link
Collaborator

Queued 0313714872a1265ca2e99812c4bd550ede699c36 with parent 56a35bc, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (0313714872a1265ca2e99812c4bd550ede699c36): comparison URL.

Overall result: ❌✅ regressions and improvements - 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.

Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please fix the regressions and do another perf run. If the next run shows neutral or positive results, the label will be automatically removed.

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

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean1 range count2
Regressions ❌
(primary)
2.4% [0.4%, 10.3%] 25
Regressions ❌
(secondary)
0.4% [0.2%, 0.8%] 11
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.8% [-1.1%, -0.4%] 9
All ❌✅ (primary) 2.4% [0.4%, 10.3%] 25

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.

mean1 range count2
Regressions ❌
(primary)
3.0% [2.5%, 3.5%] 2
Regressions ❌
(secondary)
3.7% [1.4%, 6.2%] 6
Improvements ✅
(primary)
-2.8% [-2.8%, -2.8%] 1
Improvements ✅
(secondary)
-4.6% [-7.1%, -2.2%] 3
All ❌✅ (primary) 1.1% [-2.8%, 3.5%] 3

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.

mean1 range count2
Regressions ❌
(primary)
3.9% [1.4%, 11.8%] 16
Regressions ❌
(secondary)
3.4% [2.5%, 4.7%] 9
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 3.9% [1.4%, 11.8%] 16

Footnotes

  1. the arithmetic mean of the percent change 2 3

  2. number of relevant changes 2 3

@rustbot rustbot added perf-regression Performance regression. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Oct 2, 2022
@nikic
Copy link
Contributor Author

nikic commented Oct 2, 2022

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

@rustbot label: +S-waiting-on-perf

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Oct 2, 2022
@bors
Copy link
Collaborator

bors commented Oct 2, 2022

⌛ Trying commit f17487c with merge d90a71088abba338d8ce895e5629606839186f7c...

@rust-log-analyzer
Copy link
Collaborator

The job mingw-check failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
configure: rust.debug-assertions := True
configure: rust.overflow-checks := True
configure: llvm.assertions      := True
configure: dist.missing-tools   := True
configure: build.configure-args := ['--enable-sccache', '--disable-manage-submodu ...
configure: writing `config.toml` in current directory
configure: 
configure: run `python /checkout/x.py --help`
Attempting with retry: make prepare
---
skip untracked path cpu-usage.csv during rustfmt invocations
skip untracked path src/doc/book/ during rustfmt invocations
skip untracked path src/doc/rust-by-example/ during rustfmt invocations
skip untracked path src/llvm-project/ during rustfmt invocations
Diff in /checkout/library/alloc/src/vec/mod.rs at line 2924:
                     ptr::drop_in_place(ptr::slice_from_raw_parts_mut(vec.as_mut_ptr(), vec.len))
             }
             }
-            unsafe { drop_via_slice(self); }
+            unsafe {
+                drop_via_slice(self);
         }
         }
         // RawVec handles deallocation
     }
Running `"/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/rustfmt" "--config-path" "/checkout" "--edition" "2021" "--unstable-features" "--skip-children" "--check" "/checkout/library/alloc/src/alloc/tests.rs" "/checkout/library/alloc/src/vec/drain_filter.rs" "/checkout/library/alloc/src/raw_vec.rs" "/checkout/library/alloc/src/vec/mod.rs" "/checkout/library/alloc/src/rc.rs" "/checkout/library/alloc/src/vec/spec_extend.rs" "/checkout/library/alloc/src/string.rs" "/checkout/library/alloc/src/vec/into_iter.rs"` failed.
If you're running `tidy`, try again with `--bless`. Or, if you just want to format code, run `./x.py fmt` instead.

@bors
Copy link
Collaborator

bors commented Oct 2, 2022

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

1 similar comment
@bors
Copy link
Collaborator

bors commented Oct 2, 2022

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

@rust-timer
Copy link
Collaborator

Queued d90a71088abba338d8ce895e5629606839186f7c with parent c2590e6, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (d90a71088abba338d8ce895e5629606839186f7c): comparison URL.

Overall result: ❌✅ regressions and improvements - 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.

Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please fix the regressions and do another perf run. If the next run shows neutral or positive results, the label will be automatically removed.

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

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean1 range count2
Regressions ❌
(primary)
2.6% [0.3%, 6.2%] 23
Regressions ❌
(secondary)
2.2% [0.4%, 5.5%] 5
Improvements ✅
(primary)
-0.7% [-0.8%, -0.5%] 2
Improvements ✅
(secondary)
-1.4% [-1.9%, -0.9%] 8
All ❌✅ (primary) 2.3% [-0.8%, 6.2%] 25

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.

mean1 range count2
Regressions ❌
(primary)
3.2% [3.2%, 3.2%] 1
Regressions ❌
(secondary)
3.0% [2.9%, 3.1%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 3.2% [3.2%, 3.2%] 1

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.

mean1 range count2
Regressions ❌
(primary)
3.8% [1.9%, 6.8%] 15
Regressions ❌
(secondary)
4.7% [2.9%, 6.5%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 3.8% [1.9%, 6.8%] 15

Footnotes

  1. the arithmetic mean of the percent change 2 3

  2. number of relevant changes 2 3

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Oct 2, 2022
@nikic
Copy link
Contributor Author

nikic commented Oct 2, 2022

Those are some surprisingly large effects, but not positive ones... Clearly not worthwhile in this form.

@nikic nikic closed this Oct 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
perf-regression Performance regression. 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants