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 call temporary_scope twice. #108692

Merged
merged 1 commit into from
Mar 4, 2023

Conversation

nnethercote
Copy link
Contributor

mirror_expr_inner calls temporary_scope. It then calls make_mirror_unadjusted which makes an identical call to temporary_scope.

This commit changes the mirror_expr_inner to get the temp_lifetime out of the expression produced by make_mirror_unadjusted, similar to how it currently gets the type.

r? @cjgillot

`mirror_expr_inner` calls `temporary_scope`. It then calls
`make_mirror_unadjusted` which makes an identical call to
`temporary_scope`.

This commit changes the `mirror_expr_inner` to get the `temp_lifetime`
out of the expression produced by `make_mirror_unadjusted`, similar to
how it currently gets the type.
@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 3, 2023
@nnethercote
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 3, 2023
@bors
Copy link
Contributor

bors commented Mar 3, 2023

⌛ Trying commit 6b9c412 with merge 77fbe01754d928b0abe469e83464bf87d78ab9d1...

@bors
Copy link
Contributor

bors commented Mar 3, 2023

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

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (77fbe01754d928b0abe469e83464bf87d78ab9d1): comparison URL.

Overall result: ✅ improvements - no 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.

@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
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.3% [-0.6%, -0.2%] 14
Improvements ✅
(secondary)
-0.9% [-1.5%, -0.3%] 30
All ❌✅ (primary) -0.3% [-0.6%, -0.2%] 14

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.9% [0.7%, 1.0%] 3
Regressions ❌
(secondary)
1.4% [1.4%, 1.4%] 1
Improvements ✅
(primary)
-2.9% [-2.9%, -2.9%] 1
Improvements ✅
(secondary)
-2.5% [-3.5%, -1.6%] 2
All ❌✅ (primary) -0.0% [-2.9%, 1.0%] 4

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)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-1.9% [-2.3%, -1.3%] 4
All ❌✅ (primary) - - 0

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

cjgillot commented Mar 3, 2023

That's unexpected for a 2 line change.
@bors r+

@bors
Copy link
Contributor

bors commented Mar 3, 2023

📌 Commit 6b9c412 has been approved by cjgillot

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Mar 3, 2023

🌲 The tree is currently closed for pull requests below priority 100. This pull request will be tested once the tree is reopened.

@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 3, 2023
@nnethercote
Copy link
Contributor Author

That's unexpected for a 2 line change.

I go where the profilers take me :)

@bors
Copy link
Contributor

bors commented Mar 4, 2023

⌛ Testing commit 6b9c412 with merge b171953...

@bors
Copy link
Contributor

bors commented Mar 4, 2023

☀️ Test successful - checks-actions
Approved by: cjgillot
Pushing b171953 to master...

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

Finished benchmarking commit (b171953): comparison URL.

Overall result: ✅ improvements - no action needed

@rustbot label: -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
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.3% [-0.6%, -0.2%] 15
Improvements ✅
(secondary)
-1.0% [-1.5%, -0.4%] 27
All ❌✅ (primary) -0.3% [-0.6%, -0.2%] 15

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)
-4.2% [-4.2%, -4.2%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -4.2% [-4.2%, -4.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.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-1.7% [-2.0%, -1.4%] 2
All ❌✅ (primary) - - 0

@nnethercote nnethercote deleted the dont-call-temporary_scope-twice branch March 4, 2023 22:55
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-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.

5 participants