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

Wrap the whole LocalInfo in ClearCrossCrate. #108944

Merged
merged 6 commits into from
Mar 16, 2023

Conversation

cjgillot
Copy link
Contributor

@cjgillot cjgillot commented Mar 9, 2023

MIR contains a lot of information about locals. The primary purpose of this information is the quality of borrowck diagnostics.

This PR aims to drop this information after MIR analyses are finished, ie. starting from post-cleanup runtime MIR.

@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 Mar 9, 2023
@cjgillot

This comment was marked as outdated.

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Mar 9, 2023
@bors
Copy link
Contributor

bors commented Mar 9, 2023

⌛ Trying commit 345a9749c71bab291a3ffb43e0194342ae11291a with merge a2523b11c11aa554813e8ecc01272e3bb92ba1d2...

@bors

This comment was marked as outdated.

@rust-timer

This comment has been minimized.

@rust-timer

This comment was marked as outdated.

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Mar 9, 2023
@cjgillot
Copy link
Contributor Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Mar 10, 2023
@bors

This comment was marked as outdated.

@bors

This comment was marked as outdated.

1 similar comment
@bors

This comment was marked as duplicate.

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (d6008dafc64975183e3a82d2e5083652a5f4c404): 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-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.

mean range count
Regressions ❌
(primary)
1.5% [1.1%, 1.9%] 5
Regressions ❌
(secondary)
1.9% [1.1%, 2.9%] 15
Improvements ✅
(primary)
-0.8% [-1.3%, -0.2%] 61
Improvements ✅
(secondary)
-1.0% [-2.6%, -0.4%] 12
All ❌✅ (primary) -0.6% [-1.3%, 1.9%] 66

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.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
2.1% [1.1%, 3.1%] 3
Improvements ✅
(primary)
-1.4% [-3.5%, -0.1%] 27
Improvements ✅
(secondary)
-2.4% [-4.0%, -0.8%] 18
All ❌✅ (primary) -1.4% [-3.5%, -0.1%] 27

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.

mean range count
Regressions ❌
(primary)
1.5% [1.5%, 1.5%] 2
Regressions ❌
(secondary)
2.6% [2.2%, 3.6%] 9
Improvements ✅
(primary)
-1.2% [-1.4%, -1.1%] 4
Improvements ✅
(secondary)
-2.0% [-2.0%, -2.0%] 1
All ❌✅ (primary) -0.3% [-1.4%, 1.5%] 6

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Mar 10, 2023
@cjgillot
Copy link
Contributor Author

Perf: ~0.8% improvement in instruction count, driven by reduced crate metadata encoding/decoding (crate_metadata -1.8%).
Two outliers: unicode-normalization (more calls to relate) and ucd (more calls to coerce_unsized). I don't understand yet why.

r? compiler

@cjgillot cjgillot marked this pull request as ready for review March 10, 2023 18:12
@rustbot
Copy link
Collaborator

rustbot commented Mar 10, 2023

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

@oli-obk
Copy link
Contributor

oli-obk commented Mar 10, 2023

clippy tests also need some blessing.

r? @oli-obk

@rustbot rustbot assigned oli-obk and unassigned lcnr Mar 10, 2023
@bors
Copy link
Contributor

bors commented Mar 15, 2023

📌 Commit 2adf2cd has been approved by oli-obk

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 Mar 15, 2023
@bors
Copy link
Contributor

bors commented Mar 16, 2023

⌛ Testing commit 2adf2cd with merge 511364e...

@bors
Copy link
Contributor

bors commented Mar 16, 2023

☀️ Test successful - checks-actions
Approved by: oli-obk
Pushing 511364e to master...

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (511364e): comparison URL.

Overall result: ❌✅ regressions and improvements - ACTION NEEDED

Next Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please open an issue or create a new PR that fixes the regressions, add a comment linking to the newly created issue or PR, and then add the perf-regression-triaged label to this PR.

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

Instruction count

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

mean range count
Regressions ❌
(primary)
1.6% [0.3%, 2.4%] 6
Regressions ❌
(secondary)
1.7% [1.0%, 2.9%] 16
Improvements ✅
(primary)
-0.8% [-1.3%, -0.5%] 45
Improvements ✅
(secondary)
-0.8% [-0.8%, -0.7%] 5
All ❌✅ (primary) -0.5% [-1.3%, 2.4%] 51

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.

mean range count
Regressions ❌
(primary)
2.5% [2.5%, 2.5%] 1
Regressions ❌
(secondary)
2.0% [1.0%, 3.0%] 5
Improvements ✅
(primary)
-1.2% [-2.1%, -0.7%] 12
Improvements ✅
(secondary)
-2.8% [-3.3%, -1.3%] 9
All ❌✅ (primary) -0.9% [-2.1%, 2.5%] 13

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.

mean range count
Regressions ❌
(primary)
1.9% [1.6%, 2.2%] 4
Regressions ❌
(secondary)
2.6% [2.2%, 3.3%] 10
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.9% [1.6%, 2.2%] 4

@cjgillot cjgillot deleted the clear-local-info branch March 18, 2023 10:07
@cjgillot
Copy link
Contributor Author

Perf report : identical to #108944 (comment)
The improvement is in crate metadata size, on average -1.8% up to 5%.

@nnethercote
Copy link
Contributor

A lot of movement in many metrics in those results. Cycles and wall-time look a little worse than instruction counts, like they are slight regressions overall. Results in secondary benchmarks are worse than primary benchmarks (which is better than the other way around). But binary size reductions are quite high on numerous benchmarks. I guess overall you could say all of this balances out.

@pnkfelix
Copy link
Member

  • primary instruction count regression was to unicode normalization (5 variations in [1.5%, 2.4%] range). Slightly more muted for cycle count and wall time there.
  • as noted by @lqd and @nnethercote on PR comments: crate metadata + binary size improved all around.
  • overall this is a win
  • marking as triaged.

@rustbot label: +perf-regression-triaged

@ryoqun
Copy link
Contributor

ryoqun commented May 26, 2023

@cjgillot hi, it seems that this pr introduced some clippy false-positves of redundant_clone.

namely, rust-lang/rust-clippy#10577 and rust-lang/rust-clippy#10517 (added testcases)

and maybe this too: rust-lang/rust-clippy#10545

I concluded this bisect with this branch: https://github.com/rust-lang/rust/compare/master...ryoqun:rust:clippy-redundant-clone-false-positives?expand=1

and this command:

./x.py clean && ./x.py test src/tools/clippy

seems bunch of nightly clippy users are noticing likewise. so i think there will be more after 1.70 is released?

(EDIT: i also checked latest nightly 2023-05-26 is still affected as well)

@oli-obk
Copy link
Contributor

oli-obk commented May 26, 2023

This needs to be fixed on the clippy side. We must have been using the LocalInfo mistakenly in the clippy lint

bors added a commit to rust-lang/rust-clippy that referenced this pull request Jun 5, 2023
Move `redundant_clone` to `nursery`

changelog: [`redundant_clone`]: Move to `nursery`

A bunch of FPs in `redundant_clone` have sprung up after upstream MIR changes: rust-lang/rust#108944

- #10870
- #10577
- #10545
- #10517

r? `@flip1995`
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.

9 participants