-
Notifications
You must be signed in to change notification settings - Fork 13k
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
rustc_metadata: Optimize and document module children decoding #92086
Conversation
Some changes occurred in src/tools/clippy. cc @rust-lang/clippy Some changes occurred in cc @camelid |
(rust-highfive has picked a reviewer for you, use r? to override) |
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 62815a1f8ff0f1e06dd3f25b4aed88d32c2786f9 with merge 98c9bec5b9e4114d772623fd397e74d74b25da83... |
☀️ Try build successful - checks-actions |
Queued 98c9bec5b9e4114d772623fd397e74d74b25da83 with parent d3848cb, future comparison URL. |
Finished benchmarking commit (98c9bec5b9e4114d772623fd397e74d74b25da83): comparison url. Summary: This change led to very large relevant improvements 🎉 in compiler performance.
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 |
62815a1
to
53d308a
Compare
This should be ready now. |
This is kind of a pre-requisite for #91795, so it's better to land it sooner. |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think just one comment here.
For the most part looks okay to me, with the caveat that most of this code I've never really read before.
If it's not too much trouble, can you split the two major renames here to a separate commit? (item_children
-> module_children
and each_child_of_item
-> get_module_children
). That would make me more comfortable reviewing this,
|
||
/// Iterates over all named children of the given module, | ||
/// including both proper items and reexports. | ||
/// Module here is understood in name resolution sense - it can be a `mod` item, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The overloading of the term Module
is definitely confusing....
2af260b
to
daade27
Compare
…n(_untracked)` And `each_child_of_item` to `for_each_module_child`
Also rename `module_exports`/`export_map` to `module_reexports`/`reexport_map` for clarity.
@bors r=jackh726 |
📌 Commit 4b03fd9 has been approved by |
⌛ Testing commit 4b03fd9 with merge d4135a2a8b08d4b9afb1ae4980ed1b8914b6af14... |
💥 Test timed out |
@bors retry |
☀️ Test successful - checks-actions |
Tested on commit rust-lang/rust@e19ca1d. Direct link to PR: <rust-lang/rust#92086> 💔 miri on windows: test-pass → build-fail (cc @eddyb @oli-obk @RalfJung). 💔 miri on linux: test-pass → build-fail (cc @eddyb @oli-obk @RalfJung).
Finished benchmarking commit (e19ca1d): comparison url. Summary: This change led to very large relevant improvements 🎉 in compiler performance.
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. @rustbot label: -perf-regression |
For us this mostly means changing `hir::exports::Export` to `metadata::ModChild` and `tcx.item_children` to `tcx.module_children`.
The first commit limits the item in the
item_children
/each_child_of_item
query to modules (in name resolution sense) and adds a corresponding assertion.The
associated_item_def_ids
query collecting children of traits and impls specifically now uses a simplified implementation not decoding unnecessary data instead ofeach_child_of_item
, this gives a nice performance improvement.The second commit does some renaming that clarifies the terminology used for all items in a module vs
use
items only.