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

resolve: Pre-compute non-reexport module children #110160

Merged
merged 1 commit into from
Apr 14, 2023

Conversation

petrochenkov
Copy link
Contributor

Instead of repeating the same logic by walking HIR during metadata encoding.

The only difference is that we are no longer encoding macro_rules items, but we never currently need them as a part of this list. They can be encoded separately if this need ever arises.

module_reexports is also un-querified, because I don't see any reasons to make it a query, only overhead.

@rustbot
Copy link
Collaborator

rustbot commented Apr 10, 2023

r? @compiler-errors

(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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Apr 10, 2023
@petrochenkov
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 Apr 10, 2023
@bors
Copy link
Contributor

bors commented Apr 10, 2023

⌛ Trying commit 7f89194ea8ce4ab3b7a465d1caed926a489e8601 with merge ae0a3ff508bc3d46b096586d3b5848bd746e5c1c...

@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 Apr 10, 2023
@bors
Copy link
Contributor

bors commented Apr 10, 2023

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

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (ae0a3ff508bc3d46b096586d3b5848bd746e5c1c): 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.9% [-1.4%, -0.3%] 19
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.9% [-1.4%, -0.3%] 19

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)
1.0% [0.7%, 1.3%] 4
Regressions ❌
(secondary)
2.1% [1.5%, 2.5%] 3
Improvements ✅
(primary)
-0.7% [-0.7%, -0.7%] 1
Improvements ✅
(secondary)
-4.3% [-7.1%, -1.5%] 2
All ❌✅ (primary) 0.7% [-0.7%, 1.3%] 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)
- - 0
Improvements ✅
(primary)
-0.6% [-0.8%, -0.4%] 4
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.6% [-0.8%, -0.4%] 4

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Apr 11, 2023
@rust-log-analyzer

This comment was marked as resolved.

1 similar comment
@rust-log-analyzer

This comment was marked as resolved.

@rustbot
Copy link
Collaborator

rustbot commented Apr 11, 2023

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

@petrochenkov
Copy link
Contributor Author

@rustbot ready

@rustbot rustbot 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 Apr 11, 2023
compiler/rustc_middle/src/ty/context.rs Show resolved Hide resolved
let res = binding.res().expect_non_local();
if !binding.is_import() {
non_reexports.push(res.def_id().expect_local());
} else if res != def::Res::Err && !binding.is_ambiguity() {
Copy link
Contributor

Choose a reason for hiding this comment

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

For Res::Err and ambiguities, should this closure just be a no-op?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, those are effectively imports that import nothing, at least from other crates' points of view.
(Although for ambiguities it's an open question - #36837.)

@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 Apr 12, 2023
Instead of repeating the same logic by walking HIR during metadata encoding.

The only difference is that we are no longer encoding `macro_rules` items, but we never currently need them as a part of this list.
They can be encoded separately if this need ever arises.

`module_reexports` is also un-querified, because I don't see any reasons to make it a query, only overhead.
@petrochenkov
Copy link
Contributor Author

@rustbot ready

@rustbot rustbot 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 Apr 12, 2023
@compiler-errors
Copy link
Member

r? @cjgillot

@rustbot rustbot assigned cjgillot and unassigned compiler-errors Apr 12, 2023
@cjgillot
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Apr 13, 2023

📌 Commit 7c40a6f has been approved by cjgillot

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 Apr 13, 2023
@bors
Copy link
Contributor

bors commented Apr 14, 2023

⌛ Testing commit 7c40a6f with merge 7a78c4f...

@bors
Copy link
Contributor

bors commented Apr 14, 2023

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

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Apr 14, 2023
@bors bors merged commit 7a78c4f into rust-lang:master Apr 14, 2023
@rustbot rustbot added this to the 1.70.0 milestone Apr 14, 2023
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (7a78c4f): 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.8% [-1.5%, -0.2%] 26
Improvements ✅
(secondary)
-0.3% [-0.3%, -0.3%] 1
All ❌✅ (primary) -0.8% [-1.5%, -0.2%] 26

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

Cycles

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

flip1995 pushed a commit to flip1995/rust that referenced this pull request May 5, 2023
resolve: Pre-compute non-reexport module children

Instead of repeating the same logic by walking HIR during metadata encoding.

The only difference is that we are no longer encoding `macro_rules` items, but we never currently need them as a part of this list. They can be encoded separately if this need ever arises.

`module_reexports` is also un-querified, because I don't see any reasons to make it a query, only overhead.
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. T-rustdoc Relevant to the rustdoc 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