-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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: Do not encode unnecessary module children #95899
Conversation
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 36ba6536d5fe584045342593906442662c178063 with merge ab97670d6b187ca5c79ef1f034cb0cf847d414a0... |
☀️ Try build successful - checks-actions |
Queued ab97670d6b187ca5c79ef1f034cb0cf847d414a0 with parent 027a232, future comparison URL. |
Finished benchmarking commit (ab97670d6b187ca5c79ef1f034cb0cf847d414a0): comparison url. Summary:
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 may lead to changes in compiler perf. @bors rollup=never Footnotes |
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 2500d5ef21981b32ddd0c07426622466ed9a88f7 with merge 375662f24f455afd30df0f92c7fe92d4c168bbb8... |
☀️ Try build successful - checks-actions |
Queued 375662f24f455afd30df0f92c7fe92d4c168bbb8 with parent 90ca447, future comparison URL. |
Finished benchmarking commit (375662f24f455afd30df0f92c7fe92d4c168bbb8): comparison url. Summary:
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 may lead to changes in compiler perf. @bors rollup=never Footnotes |
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.
This feels so much cleaner!
Should we use the same iter_from_generator
to make for_each_module_child
return an iterator?
} | ||
|
||
/// An adapter for turning a generator closure into an iterator, similar to `iter::from_fn`. | ||
pub fn iter_from_generator<G: Generator + Unpin>(generator: G) -> impl Iterator<Item = G::Yield> { |
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 almost feel this should be in std
.
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'll make separate PR to add this to libcore, not sure whether it will be merged and how much time it may take.
I don't know why this functionality wasn't added yet, maybe there are reasons - the body of work produced by async-wg is vast, but I didn't read any of it.
I'll try to do it a bit later in a separate PR. FWIW, I also tried to move insertion of struct/variant constructors to module children lists from decoding to encoding, but encountered some ICE in @rustbot ready |
@bors r+ |
📌 Commit 233fa65 has been approved by |
☀️ Test successful - checks-actions |
Finished benchmarking commit (563ef23): comparison url. Summary:
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 Footnotes |
rustc_metadata: Add struct and variant constructors to module children at encoding time instead of decoding time. Continuation of rust-lang#95899. The last time it caused some ICEs from generator use, but not everything seems ok.
This should remove the syntax context shift and the special case for
ExternCrate
in decoder in #95880.This PR also shifts some work from decoding to encoding, which is typically useful for performance (but probably not much in this case).
r? @cjgillot