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

[perf] Loan liveness frontier slowness evaluation #112432

Closed
wants to merge 8 commits into from

Conversation

lqd
Copy link
Member

@lqd lqd commented Jun 8, 2023

It doesn't feel that much slower on UI tests, but will probably scale badly on realistic code, so let's see how terribly it performs.

r? @ghost

@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 Jun 8, 2023
@lqd
Copy link
Member Author

lqd commented Jun 8, 2023

@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 Jun 8, 2023
@bors
Copy link
Contributor

bors commented Jun 8, 2023

⌛ Trying commit fff2a32f5c6e40599f9fcc713323037667f9d7e8 with merge 272c25090e41e0e5d04bfe45e3c04016d4c6b0a6...

@bors
Copy link
Contributor

bors commented Jun 8, 2023

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

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (272c25090e41e0e5d04bfe45e3c04016d4c6b0a6): comparison URL.

Overall result: ❌ regressions - 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)
23.3% [0.2%, 1404.2%] 181
Regressions ❌
(secondary)
48.2% [0.1%, 1105.8%] 96
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.5% [-0.6%, -0.4%] 9
All ❌✅ (primary) 23.3% [0.2%, 1404.2%] 181

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)
-3.4% [-4.0%, -2.8%] 3
Improvements ✅
(secondary)
-2.0% [-2.7%, -0.8%] 8
All ❌✅ (primary) -3.4% [-4.0%, -2.8%] 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.

mean range count
Regressions ❌
(primary)
31.2% [1.2%, 478.1%] 45
Regressions ❌
(secondary)
156.4% [2.3%, 502.4%] 13
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 31.2% [1.2%, 478.1%] 45

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 648.127s -> 661.135s (2.01%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Jun 8, 2023
@lqd
Copy link
Member Author

lqd commented Jun 8, 2023

That's more like it.

@lqd lqd closed this Jun 8, 2023
@lqd lqd reopened this Jun 9, 2023
@lqd
Copy link
Member Author

lqd commented Jun 9, 2023

@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 Jun 9, 2023
@bors
Copy link
Contributor

bors commented Jun 9, 2023

⌛ Trying commit db6a863c8f0a04969e7e628ce2a6ffffde30769f with merge 48ab5baa844649d42689b368717f6140000cd402...

@bors
Copy link
Contributor

bors commented Jun 9, 2023

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

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (48ab5baa844649d42689b368717f6140000cd402): 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.6% [0.2%, 9.5%] 24
Regressions ❌
(secondary)
2.8% [1.8%, 4.0%] 6
Improvements ✅
(primary)
-0.6% [-0.7%, -0.6%] 3
Improvements ✅
(secondary)
-0.4% [-0.6%, -0.3%] 8
All ❌✅ (primary) 1.4% [-0.7%, 9.5%] 27

Max RSS (memory usage)

This benchmark run did not return any relevant results for this metric.

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)
3.2% [1.1%, 5.6%] 11
Regressions ❌
(secondary)
2.6% [2.6%, 2.6%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.0% [-2.0%, -2.0%] 1
All ❌✅ (primary) 3.2% [1.1%, 5.6%] 11

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 649.935s -> 649.406s (-0.08%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jun 9, 2023
@lqd lqd closed this Jun 9, 2023
@lqd lqd reopened this Jun 23, 2023
@lqd
Copy link
Member Author

lqd commented Jun 24, 2023

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@lqd lqd closed this Sep 8, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 5, 2023
Compute NLL loan scopes using the polonius model

Draft PR to guide discussion for this monday's types team meeting, where the plan is to read this and review as a group.

For a *location-insensitive* analysis (that is, without expressiveness improvements for users yet), this PR implements loans going out of scope using reachability and liveness, rather than checking if the issuing region's values contain a given CFG point. This is equivalent to NLL scopes and computes the same data.

There are a few fixmes left, and I'll still work on them before the meeting.

A couple of notes:
- I started prototyping this a while ago so it follows the structure of the _previous_ NLL `OutOfScopePrecomputer`, before the couple recent refactors. They probably could/should look the same instead.
- there are some assumptions about placeholders, free regions, and member constraints that I think hold, and they're documented in the code
- this passes all the UI tests with `-Zpolonius=next` -- though the additional work done can be felt on the huge numeric/float tests, but the perf is [not terrible](rust-lang#112432 (comment)) and there are a bunch of ways to improve it in the future.

(cc `@matthewjasper` since you asked to be pinged about it)

r? `@ghost`
@lqd lqd reopened this Oct 5, 2023
@lqd
Copy link
Member Author

lqd commented Oct 5, 2023

@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 Oct 5, 2023
@bors
Copy link
Contributor

bors commented Oct 5, 2023

⌛ Trying commit 99e0fc2 with merge 5281eea...

bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 5, 2023
[perf] Loan liveness frontier slowness evaluation

It doesn't feel that much slower on UI tests, but will probably scale badly on realistic code, so let's see how terribly it performs.

r? `@ghost`
@lqd
Copy link
Member Author

lqd commented Oct 5, 2023

the previous run is going to be busted but the force push didn't kill it.

tests are now fixed

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Oct 5, 2023

⌛ Trying commit 8d5cbc6 with merge a2f1897...

bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 5, 2023
[perf] Loan liveness frontier slowness evaluation

It doesn't feel that much slower on UI tests, but will probably scale badly on realistic code, so let's see how terribly it performs.

r? `@ghost`
@bors bors mentioned this pull request Oct 5, 2023
@bors
Copy link
Contributor

bors commented Oct 5, 2023

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

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (a2f1897): 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.6% [0.2%, 2.7%] 36
Regressions ❌
(secondary)
0.6% [0.3%, 0.8%] 5
Improvements ✅
(primary)
-0.8% [-0.8%, -0.7%] 4
Improvements ✅
(secondary)
-0.7% [-0.7%, -0.6%] 3
All ❌✅ (primary) 0.4% [-0.8%, 2.7%] 40

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

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

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 623.65s -> 622.591s (-0.17%)
Artifact size: 271.98 MiB -> 271.98 MiB (-0.00%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Oct 5, 2023
@lqd lqd closed this Oct 6, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 11, 2023
Compute NLL loan scopes using the polonius model

For a *location-insensitive* analysis (that is, without expressiveness improvements for users yet), this PR implements loans going out of scope using reachability and liveness, rather than checking if the issuing region's values contain a given CFG point. This is equivalent to NLL scopes and computes the same data.

r? `@matthewjasper`

A couple of notes:
- there are some assumptions about SCC representatives, placeholders, free regions, and member constraints that I believe hold, and they're documented in the code
- this passes all the UI tests with `-Zpolonius=next` -- the perf is [not terrible](rust-lang#112432 (comment)) and there are a bunch of ways to improve it in the future.
- there's a fixme left, hopefully Matthew you know a clean way to get the information it mentions.
github-actions bot pushed a commit to rust-lang/miri that referenced this pull request Oct 12, 2023
Compute NLL loan scopes using the polonius model

For a *location-insensitive* analysis (that is, without expressiveness improvements for users yet), this PR implements loans going out of scope using reachability and liveness, rather than checking if the issuing region's values contain a given CFG point. This is equivalent to NLL scopes and computes the same data.

r? `@matthewjasper`

A couple of notes:
- there are some assumptions about SCC representatives, placeholders, free regions, and member constraints that I believe hold, and they're documented in the code
- this passes all the UI tests with `-Zpolonius=next` -- the perf is [not terrible](rust-lang/rust#112432 (comment)) and there are a bunch of ways to improve it in the future.
- there's a fixme left, hopefully Matthew you know a clean way to get the information it mentions.
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-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.

4 participants