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

Don't generate unecessary &&self.field in deriving Debug #107599

Merged
merged 1 commit into from
Feb 3, 2023

Conversation

clubby789
Copy link
Contributor

Since unsized fields may only be the last one in a struct, we only need to generate a double reference (&&self.field) for the final one.

cc @nnethercote

@rustbot
Copy link
Collaborator

rustbot commented Feb 2, 2023

r? @lcnr

(rustbot has picked a reviewer for you, use r? to override)

@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 Feb 2, 2023
@Noratrieb
Copy link
Member

@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 Feb 2, 2023
@bors
Copy link
Contributor

bors commented Feb 2, 2023

⌛ Trying commit a61ba621df635d2b44336422189d813a698461b0 with merge 0c567e3f492ab5edc9a8b5b787574aa6a2e37c7b...

@bors
Copy link
Contributor

bors commented Feb 2, 2023

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

@rust-timer

This comment has been minimized.

@nnethercote
Copy link
Contributor

r? @nnethercote

@rustbot rustbot assigned nnethercote and unassigned lcnr Feb 2, 2023
Copy link
Contributor

@nnethercote nnethercote left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks reasonable, just some nitpicks. Thanks.

compiler/rustc_builtin_macros/src/deriving/debug.rs Outdated Show resolved Hide resolved
compiler/rustc_builtin_macros/src/deriving/debug.rs Outdated Show resolved Hide resolved
compiler/rustc_builtin_macros/src/deriving/debug.rs Outdated Show resolved Hide resolved
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (0c567e3f492ab5edc9a8b5b787574aa6a2e37c7b): 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)
0.4% [0.3%, 0.4%] 3
Regressions ❌
(secondary)
0.7% [0.2%, 1.3%] 10
Improvements ✅
(primary)
-1.0% [-2.9%, -0.4%] 9
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.7% [-2.9%, 0.4%] 12

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.0% [1.1%, 2.9%] 2
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-3.5% [-7.8%, -0.1%] 3
Improvements ✅
(secondary)
-1.5% [-2.6%, -0.6%] 4
All ❌✅ (primary) -1.3% [-7.8%, 2.9%] 5

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)
- - 0
Regressions ❌
(secondary)
1.1% [1.1%, 1.1%] 1
Improvements ✅
(primary)
-2.2% [-3.4%, -1.3%] 4
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -2.2% [-3.4%, -1.3%] 4

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Feb 2, 2023
@nnethercote
Copy link
Contributor

I strongly suspect those perf results are noise, this change really shouldn't impact perf on those benchmarks in any significant way.

@bors r+

@bors
Copy link
Contributor

bors commented Feb 2, 2023

📌 Commit d8651aa has been approved by nnethercote

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 Feb 2, 2023
@bors
Copy link
Contributor

bors commented Feb 3, 2023

⌛ Testing commit d8651aa with merge 9545094...

@bors
Copy link
Contributor

bors commented Feb 3, 2023

☀️ Test successful - checks-actions
Approved by: nnethercote
Pushing 9545094 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Feb 3, 2023
@bors bors merged commit 9545094 into rust-lang:master Feb 3, 2023
@rustbot rustbot added this to the 1.69.0 milestone Feb 3, 2023
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (9545094): 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)
0.4% [0.3%, 0.4%] 2
Regressions ❌
(secondary)
1.0% [0.2%, 4.9%] 7
Improvements ✅
(primary)
-1.0% [-2.9%, -0.4%] 9
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.8% [-2.9%, 0.4%] 11

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)
- - 0
Improvements ✅
(primary)
-2.7% [-8.2%, -0.1%] 8
Improvements ✅
(secondary)
-2.6% [-4.6%, -0.8%] 44
All ❌✅ (primary) -2.7% [-8.2%, -0.1%] 8

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)
- - 0
Regressions ❌
(secondary)
2.6% [2.6%, 2.6%] 1
Improvements ✅
(primary)
-2.4% [-3.2%, -1.4%] 3
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -2.4% [-3.2%, -1.4%] 3

@nnethercote
Copy link
Contributor

I think this is noisy. The pre-merge perf run also had quite some variance, though it looked a bit different. Also, there's no good reason why this change should make much difference.

@rustbot label: +perf-regression-triaged

@rustbot rustbot added the perf-regression-triaged The performance regression has been triaged. label Feb 3, 2023
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.

7 participants