-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Extract suitable code from rustc_query_impl into a new crate rustc_query_misc #115118
Conversation
These commits modify the If this was unintentional then you should revert the changes before this PR is merged. |
This comment has been minimized.
This comment has been minimized.
0f950d4
to
f53c0ee
Compare
I'm not sure I understand the benefit. This crate is still on the critical path |
Thanks to build pipelining cargo can invoke rustc for a dependent crate while dependencies are still busy with codegen. Only crate metadata writing needs to have finished. |
It's a benefit when compiling with |
☔ The latest upstream changes (presumably #115326) made this pull request unmergeable. Please resolve the merge conflicts. |
f53c0ee
to
6ce11f8
Compare
So we split the crate in 2 codegen units, to counteract the fact we ask for only 1? The split does not follow a functional separation of the crate. The large macro is still there, structured the same way. How should we chose in which crate code goes? Is there a way to get rid of the dependency between query_misc and query_impl? |
Basically, but we can do it without a performance hit, unlike the automatic partitioning.
In general, hot direct calls stays in the same crate, while cold or indirect calls can cross crate boundaries.
Yes, but it's not very beneficial as they mostly spend their time in code generation. It's also would require another copy of the macro mentioned. |
☔ The latest upstream changes (presumably #115518) made this pull request unmergeable. Please resolve the merge conflicts. |
6ce11f8
to
bb1d854
Compare
Here's a link to the new compilation timings. |
☔ The latest upstream changes (presumably #115820) made this pull request unmergeable. Please resolve the merge conflicts. |
bb1d854
to
7daca2c
Compare
☔ The latest upstream changes (presumably #115920) made this pull request unmergeable. Please resolve the merge conflicts. |
7daca2c
to
c9ce621
Compare
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
Extract suitable code from rustc_query_impl into a new crate rustc_query_misc This extracts code from `rustc_query_impl` into a new crate `rustc_query_misc` in order to reduce the compile time of `rustc_query_impl`. The compile time of the new crate is roughly 60% of the remaining `rustc_query_impl` . I've picked code which should not impact performance or result in duplicate generic code generation. Encoding and decoding of query results and profiling handling is moved along with some other minor methods which use dynamic dispatch. r? `@cjgillot`
Making my review in #115118 (comment) more explicit. I think this PR introduces complexity with no reason beyond bootstrap time. I would accept a PR splitting |
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (3d352fd): comparison URL. Overall result: ❌ regressions - ACTION NEEDEDBenchmarking 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. Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @bors rollup=never Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis 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.
CyclesResultsThis 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.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 621.055s -> 622.704s (0.27%) |
Flipping the review switch to the author, I think there are some design questions at this comment on how to proceed. @rustbot author |
Ping from triage: |
This extracts code from
rustc_query_impl
into a new craterustc_query_misc
in order to reduce the compile time ofrustc_query_impl
. The compile time of the new crate is roughly 60% of the remainingrustc_query_impl
.I've picked code which should not impact performance or result in duplicate generic code generation. Encoding and decoding of query results and profiling handling is moved along with some other minor methods which use dynamic dispatch.
r? @cjgillot