break rustc_expand-rustc_middle dependency - #161263
Conversation
|
These commits modify the If this was unintentional then you should revert the changes before this PR is merged. Some changes occurred in src/tools/cargo cc @weihanglo |
|
rustbot has assigned @JonathanBrouwer. Use Why was this reviewer chosen?The reviewer was selected based on:
|
This comment has been minimized.
This comment has been minimized.
|
Shouldn't show up in single job benchmarks, but still: I'll also do another benchmark later where the derive expander is always called through the atomic ref (with @bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
break rustc_expand-rustc_middle dependency
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (e3517d8): comparison URL. Overall result: no relevant changes - no action neededBenchmarking means the PR may be perf-sensitive. Consider adding rollup=never if this change is not fit for rolling up. @rustbot label: -S-waiting-on-perf -perf-regression Instruction countThis perf run didn't have relevant results for this metric. Max RSS (memory usage)Results (secondary 2.4%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesThis perf run didn't have relevant results for this metric. Binary sizeResults (primary 0.1%, secondary 0.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Bootstrap: 457.751s -> 466.084s (1.82%) |
|
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
break rustc_expand-rustc_middle dependency
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (8fa19ca): comparison URL. Overall result: no relevant changes - no action neededBenchmarking means the PR may be perf-sensitive. Consider adding rollup=never if this change is not fit for rolling up. @rustbot label: -S-waiting-on-perf -perf-regression Instruction countThis perf run didn't have relevant results for this metric. Max RSS (memory usage)Results (secondary -1.7%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary 2.0%, secondary 0.8%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis perf run didn't have relevant results for this metric. Bootstrap: 455.4s -> 455.94s (0.12%) |
|
A best case scenario Goes from 15.35s -> 11.44s for me, very cool. |
|
Making sure removing the last commit did not affect perf |
This comment has been minimized.
This comment has been minimized.
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
@rustbot ready |
|
r=me with a closure #161263 (comment), unless there's a reason not to use it. |
|
Changed to use a closure. @bors r=petrochenkov |
break rustc_expand-rustc_middle dependency Back in rust-lang#145354 (cc @Kobzol), support for caching derive macros was added. With this, rustc_expand was made to depend on rustc_middle. This PR breaks that dependency so that rustc_expand and rustc_builtin_macros can compile in parallel with rustc_middle. The timing graph goes from this: <img width="451" height="438" alt="image" src="https://github.com/user-attachments/assets/2d48b0d4-443c-4ec8-b4f0-a6412e86a62f" /> to this: <img width="456" height="309" alt="image" src="https://github.com/user-attachments/assets/66519857-fa65-4794-ad66-aa565170e196" /> Note that the interval where we're exclusively compiling rustc_middle has become much shorter. Full graphs here: [cargo-timing-main.html](https://github.com/user-attachments/files/31157361/cargo-timing-main.html) [cargo-timing-expand2.html](https://github.com/user-attachments/files/31157373/cargo-timing-expand2.html) It's somewhat hard to benchmark reliably but a full bootstrap is about 5-10 seconds faster overall, on a machine with an Amd Ryzen 5900x 12-core processor.
|
@bors r=petrochenkov,JonathanBrouwer |
|
📌 Commit de40569 has been approved by It is now in the queue for this repository. 🌲 The tree is currently closed for pull requests below priority 10. This pull request will be tested once the tree is reopened. Reason for tree closure: |
…hanBrouwer break rustc_expand-rustc_middle dependency Back in rust-lang#145354 (cc @Kobzol), support for caching derive macros was added. With this, rustc_expand was made to depend on rustc_middle. This PR breaks that dependency so that rustc_expand and rustc_builtin_macros can compile in parallel with rustc_middle. The timing graph goes from this: <img width="451" height="438" alt="image" src="https://github.com/user-attachments/assets/2d48b0d4-443c-4ec8-b4f0-a6412e86a62f" /> to this: <img width="456" height="309" alt="image" src="https://github.com/user-attachments/assets/66519857-fa65-4794-ad66-aa565170e196" /> Note that the interval where we're exclusively compiling rustc_middle has become much shorter. Full graphs here: [cargo-timing-main.html](https://github.com/user-attachments/files/31157361/cargo-timing-main.html) [cargo-timing-expand2.html](https://github.com/user-attachments/files/31157373/cargo-timing-expand2.html) It's somewhat hard to benchmark reliably but a full bootstrap is about 5-10 seconds faster overall, on a machine with an Amd Ryzen 5900x 12-core processor.
View all comments
Back in #145354 (cc @Kobzol), support for caching derive macros was added. With this, rustc_expand was made to depend on rustc_middle.
This PR breaks that dependency so that rustc_expand and rustc_builtin_macros can compile in parallel with rustc_middle.
The timing graph goes from this:

to this:

Note that the interval where we're exclusively compiling rustc_middle has become much shorter.
Full graphs here:
cargo-timing-main.html
cargo-timing-expand2.html
It's somewhat hard to benchmark reliably but a full bootstrap is about 5-10 seconds faster overall, on a machine with an Amd Ryzen 5900x 12-core processor.