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

Gather module items after lowering. #88703

Merged
merged 3 commits into from
Sep 19, 2021
Merged

Gather module items after lowering. #88703

merged 3 commits into from
Sep 19, 2021

Conversation

cjgillot
Copy link
Contributor

@cjgillot cjgillot commented Sep 6, 2021

This avoids having a non-local analysis inside lowering.

By implementing hir_module_items using a visitor, we make sure that iterations and visitors are consistent.

@rust-highfive
Copy link
Collaborator

r? @jackh726

(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 6, 2021
@cjgillot
Copy link
Contributor Author

cjgillot commented Sep 6, 2021

@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 6, 2021
@bors
Copy link
Contributor

bors commented Sep 6, 2021

⌛ Trying commit 5ffc563af96b1ff14400de3a9b370af50cc5754c with merge f7a3ac3869f210540060c13cd4a57d8752d354f1...

@rust-log-analyzer

This comment has been minimized.

@cjgillot
Copy link
Contributor Author

cjgillot commented Sep 6, 2021

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

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

@bors
Copy link
Contributor

bors commented Sep 6, 2021

⌛ Trying commit e6cb0fbcfe8a5e17f29cde60d6cf93e7302ef6a0 with merge f9be3c7a2baa589da11754c257a4cef83524c9f7...

@bors
Copy link
Contributor

bors commented Sep 6, 2021

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

@rust-timer
Copy link
Collaborator

Queued f9be3c7a2baa589da11754c257a4cef83524c9f7 with parent 8ceea01, future comparison URL.

@jackh726
Copy link
Member

jackh726 commented Sep 6, 2021

r? @petrochenkov

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (f9be3c7a2baa589da11754c257a4cef83524c9f7): 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 ctfe-stress-4)
  • Very small regression in instruction counts (up to 1.1% on incr-patched: println builds of coercions)

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 6, 2021
@petrochenkov
Copy link
Contributor

r? @petrochenkov

Nooo, I only left a comment...

@petrochenkov
Copy link
Contributor

Looks like this PR does two different things:

  • Moves the global analysis pass from lowering to somewhere else.
  • Changes how iteration through modules is done - walking a single static list (no allocations or other overhead, maximum parallelism) vs. walking many lists of submodules (allocations in the queue, parallelism is apparently reduces as well).

The second part may be responsible for the perf differences.

@petrochenkov petrochenkov added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 7, 2021
@jackh726
Copy link
Member

jackh726 commented Sep 7, 2021

r? @petrochenkov

Nooo, I only left a comment...

oops, tag? (but for real, I can take back the review if you've got too much on your plate, just figured this was more along what you'd normally review ♥)

@rust-log-analyzer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 11, 2021
@petrochenkov petrochenkov removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 11, 2021
@cjgillot cjgillot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Sep 19, 2021
@petrochenkov
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Sep 19, 2021

📌 Commit 91575f8 has been approved by petrochenkov

@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 19, 2021
@petrochenkov petrochenkov removed the perf-regression Performance regression. label Sep 19, 2021
@bors
Copy link
Contributor

bors commented Sep 19, 2021

⌛ Testing commit 91575f8 with merge 7b5f952...

@bors
Copy link
Contributor

bors commented Sep 19, 2021

☀️ Test successful - checks-actions
Approved by: petrochenkov
Pushing 7b5f952 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Sep 19, 2021
@bors bors merged commit 7b5f952 into rust-lang:master Sep 19, 2021
@rustbot rustbot added this to the 1.57.0 milestone Sep 19, 2021
@cjgillot cjgillot deleted the lazymod branch September 19, 2021 20:20
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (7b5f952): comparison url.

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

  • Moderate improvement in instruction counts (up to -1.3% on incr-unchanged builds of ctfe-stress-4)
  • Moderate regression in instruction counts (up to 0.8% on incr-unchanged builds of tuple-stress)

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

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

@rustbot rustbot added the perf-regression Performance regression. label Sep 19, 2021
@pnkfelix
Copy link
Member

pnkfelix commented Sep 21, 2021

Visited for weekly performance triage. Several benchmarks improved, by around -1% (+/-0.20%).

Some others regressed, by around +0.5% (+/- 0.2%)

To me, this seems like a wash; I'm not sure its worth spending time investigating the source of the regressions.

But since this was only labelled as a perf-regression two days ago, and my own analysis is based largely on skimming with my eyeballs, I'll hold off on officially triaging it; maybe someone will notice something I missed.

@cjgillot cjgillot mentioned this pull request Sep 23, 2021
11 tasks
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. 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.

9 participants