Skip to content

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

Merged
bors merged 1 commit into
rust-lang:masterfrom
petrochenkov:notagain2
Apr 14, 2023
Merged

resolve: Pre-compute non-reexport module children#110160
bors merged 1 commit into
rust-lang:masterfrom
petrochenkov:notagain2

Conversation

@petrochenkov

Copy link
Copy Markdown
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

rustbot commented Apr 10, 2023

Copy link
Copy Markdown
Collaborator

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
Copy Markdown
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

bors commented Apr 10, 2023

Copy link
Copy Markdown
Collaborator

⌛ 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
Comment thread compiler/rustc_resolve/src/imports.rs Outdated
@bors

bors commented Apr 10, 2023

Copy link
Copy Markdown
Collaborator

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

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
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

rustbot commented Apr 11, 2023

Copy link
Copy Markdown
Collaborator

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

@petrochenkov

Copy link
Copy Markdown
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
Comment thread compiler/rustc_middle/src/ty/context.rs Outdated
Comment thread compiler/rustc_resolve/src/imports.rs Outdated

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor

r? @cjgillot

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

Copy link
Copy Markdown
Contributor

@bors r+

@bors

bors commented Apr 13, 2023

Copy link
Copy Markdown
Collaborator

📌 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

bors commented Apr 14, 2023

Copy link
Copy Markdown
Collaborator

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

@bors

bors commented Apr 14, 2023

Copy link
Copy Markdown
Collaborator

☀️ 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
Copy Markdown
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.
@petrochenkov
petrochenkov deleted the notagain2 branch February 22, 2025 18:29
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