Skip to content

Disable visible path calculation for PrettyPrinter in Ok path of compiler #89120

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

Merged
merged 1 commit into from
Sep 24, 2021

Conversation

In-line
Copy link
Contributor

@In-line In-line commented Sep 20, 2021

No description provided.

@rust-highfive
Copy link
Contributor

r? @estebank

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 20, 2021
@In-line In-line force-pushed the remove_unneded_visible_parents_map branch from 2185321 to f6fc978 Compare September 20, 2021 16:35
@In-line
Copy link
Contributor Author

In-line commented Sep 20, 2021

Please, kindly schedule a perf run

@Mark-Simulacrum
Copy link
Member

@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 Sep 20, 2021
@bors
Copy link
Collaborator

bors commented Sep 20, 2021

⌛ Trying commit f6fc9789d728bb1df6a90e50ebfcfa18aa670224 with merge 4bf6e5c32905d0f765eab7c792a5e1a72f9afee1...

@bors
Copy link
Collaborator

bors commented Sep 20, 2021

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

@rust-timer
Copy link
Collaborator

Queued 4bf6e5c32905d0f765eab7c792a5e1a72f9afee1 with parent db1fb85, future comparison URL.

@In-line In-line force-pushed the remove_unneded_visible_parents_map branch from f6fc978 to a250406 Compare September 20, 2021 18:38
@In-line
Copy link
Contributor Author

In-line commented Sep 20, 2021

I forgot to commit main check, sorry! Please cancel scheduled perf run and redo it 😄

@rust-log-analyzer

This comment has been minimized.

@In-line In-line force-pushed the remove_unneded_visible_parents_map branch from a250406 to 4ea4144 Compare September 20, 2021 20:04
@rust-log-analyzer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (4bf6e5c32905d0f765eab7c792a5e1a72f9afee1): comparison url.

Summary: This change led to small relevant mixed results 🤷 in compiler performance.

  • Small improvement in instruction counts (up to -0.5% on full builds of coercions)
  • Small regression in instruction counts (up to 0.4% on incr-unchanged builds of clap-rs)

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

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 led 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

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Sep 20, 2021
@jyn514
Copy link
Member

jyn514 commented Sep 20, 2021

@bors try @rust-timer queue

#89120 (comment)

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

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

@bors
Copy link
Collaborator

bors commented Sep 20, 2021

⌛ Trying commit 9da27f0 with merge 635ba4d6ff55c13d3f40dd9b82d773d172377606...

@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 Sep 20, 2021
@bors
Copy link
Collaborator

bors commented Sep 20, 2021

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

@rust-timer
Copy link
Collaborator

Queued 635ba4d6ff55c13d3f40dd9b82d773d172377606 with parent 60e70cc, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (635ba4d6ff55c13d3f40dd9b82d773d172377606): comparison url.

Summary: This change led to very large relevant improvements 🎉 in compiler performance.

  • Very large improvement in instruction counts (up to -23.2% on incr-full builds of await-call-tree)

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

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 led to changes in compiler perf.

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

@rustbot rustbot removed S-waiting-on-perf Status: Waiting on a perf run to be completed. perf-regression Performance regression. labels Sep 21, 2021
@In-line
Copy link
Contributor Author

In-line commented Sep 21, 2021

There are multiple benchmarks in rustc-perf, which generate a lot of warnings. Even a single warning which will print the visible path of type will invoke visible_parent_map.

This explains a lot of neutral results.

I think we have a few questions now.

  1. Is regression with uninhabited type panic acceptable?
  2. Is regression with query description acceptable?
    1. If no, will converting description() to be calculated lazily help?

For more information on impact to user, you can check out changed tests output.

@jyn514
Copy link
Member

jyn514 commented Sep 21, 2021

Wow, this is a really amazing perf improvement! Definitely don't worry about the one or two regressions, this is really good :)

My only concern is the diagnostic regressions - I'm worried it will be confusing to get errors about items that aren't publicly visible. Maybe we could change those error paths to call try_print_visible_def_path explicitly?

@jyn514
Copy link
Member

jyn514 commented Sep 21, 2021

Is regression with query description acceptable?

This seems fine to me - it should only be shown in ICE messages and logging anyway.

@Mark-Simulacrum
Copy link
Member

The query description is shown in cycle errors (as can be observed with the test result changes). I think it is unfortunate to regress there. Could we check performance impact without that change? I'd guess that it is the primary contributor here, but would be happy to be surprised.

@In-line
Copy link
Contributor Author

In-line commented Sep 21, 2021 via email

@joshtriplett joshtriplett added the relnotes-perf Performance improvements that should be mentioned in the release notes. label Sep 22, 2021
@estebank
Copy link
Contributor

My only concern is the diagnostic regressions - I'm worried it will be confusing to get errors about items that aren't publicly visible. Maybe we could change those error paths to call try_print_visible_def_path explicitly?

I think those regressions are unfortunate, but not terrible. We've had much worse diagnostic regressions in the past. As long as we have a plan, or at least a ticket to address these, I'm ok with taking that hit. (My gut tells me that cycle errors aren't as common, and if a newcomer hits them they type's paths will not be in the top 3 things that confuse them about these.)

@estebank
Copy link
Contributor

@bors r+

@bors
Copy link
Collaborator

bors commented Sep 23, 2021

📌 Commit 9da27f0 has been approved by estebank

@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 Sep 23, 2021
@bors
Copy link
Collaborator

bors commented Sep 24, 2021

⌛ Testing commit 9da27f0 with merge 197fc85...

@bors
Copy link
Collaborator

bors commented Sep 24, 2021

☀️ Test successful - checks-actions
Approved by: estebank
Pushing 197fc85 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Sep 24, 2021
@bors bors merged commit 197fc85 into rust-lang:master Sep 24, 2021
@rustbot rustbot added this to the 1.57.0 milestone Sep 24, 2021
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (197fc85): comparison url.

Summary: This change led to very large relevant improvements 🎉 in compiler performance.

  • Very large improvement in instruction counts (up to -23.1% on incr-full builds of await-call-tree)

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

@rustbot label: -perf-regression

@In-line In-line deleted the remove_unneded_visible_parents_map branch September 28, 2021 19:02
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. relnotes-perf Performance improvements that should be mentioned in the release notes. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants