Uh oh!
There was an error while loading. Please reload this page.
Pre-compute MIR CFG caches for borrowck and other analyses - #142540
Conversation
rustbot
commented
Jun 15, 2025
r? @fee1-dead rustbot has assigned @fee1-dead. Use |
rustbot
commented
Jun 15, 2025
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
cjgillot
commented
Jun 15, 2025
@bors2 try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
Pre-compute MIR CFG caches for borrowck and other analyses I was puzzled that #142390 introduces additional computations of CFG traversals: borrowck computes them, right? It turns out that borrowck clones the MIR body, so doesn't share its cache with other analyses. This PR: - forces the computation of all caches in `mir_promoted` query; - modifies region renumbering to avoid dropping that cache. <!-- homu-ignore:start --> <!-- If this PR is related to an unstable feature or an otherwise tracked effort, please link to the relevant tracking issue here. If you don't know of a related tracking issue or there are none, feel free to ignore this. This PR will get automatically assigned to a reviewer. In case you would like a specific user to review your work, you can assign it to them by using r? <reviewer name> --> <!-- homu-ignore:end -->
This comment has been minimized.
This comment has been minimized.
rust-timer
commented
Jun 15, 2025
Finished benchmarking commit (18218cc): comparison URL. Overall result: ❌ regressions - please read the text belowBenchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf. Next Steps: If you can justify the regressions found in this try perf run, please do so in sufficient writing along with @bors rollup=never Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary 1.7%, secondary 1.3%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary 1.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 756.494s -> 756.086s (-0.05%) |
Uh oh!
There was an error while loading. Please reload this page.
cjgillot
commented
Jun 15, 2025
Perf deserves investigation. I really didn't expect |
cjgillot
commented
Jun 15, 2025
@bors2 try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
Pre-compute MIR CFG caches for borrowck and other analyses I was puzzled that #142390 introduces additional computations of CFG traversals: borrowck computes them, right? It turns out that borrowck clones the MIR body, so doesn't share its cache with other analyses. This PR: - forces the computation of all caches in `mir_promoted` query; - modifies region renumbering to avoid dropping that cache. <!-- homu-ignore:start --> <!-- If this PR is related to an unstable feature or an otherwise tracked effort, please link to the relevant tracking issue here. If you don't know of a related tracking issue or there are none, feel free to ignore this. This PR will get automatically assigned to a reviewer. In case you would like a specific user to review your work, you can assign it to them by using r? <reviewer name> --> <!-- homu-ignore:end -->
This comment has been minimized.
This comment has been minimized.
rust-timer
commented
Jun 16, 2025
Finished benchmarking commit (98e2e6a): comparison URL. Overall result: ❌ regressions - please read the text belowBenchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf. Next Steps: If you can justify the regressions found in this try perf run, please do so in sufficient writing along with @bors rollup=never Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary 0.1%, secondary -2.5%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (secondary 1.2%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 755.712s -> 754.846s (-0.11%) |
cjgillot
commented
Jun 16, 2025
Rebased onto #142542 |
This comment has been minimized.
This comment has been minimized.
rustbot
commented
Oct 12, 2025
This PR was rebased onto a different master 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. |
cjgillot
commented
Oct 12, 2025
@bors2 try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Pre-compute MIR CFG caches for borrowck and other analyses
This comment has been minimized.
This comment has been minimized.
rust-timer
commented
Oct 12, 2025
Finished benchmarking commit (8e7d148): comparison URL. Overall result: ❌✅ regressions and improvements - please read the text belowBenchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf. Next Steps: If you can justify the regressions found in this try perf run, please do so in sufficient writing along with @bors rollup=never Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary -2.9%, secondary -0.7%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (secondary 0.2%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 471.991s -> 473.105s (0.24%) |
cjgillot
commented
Oct 13, 2025
I don't think I will do better here. This is an improvement on all but 2 benchmarks. I can't figure out why. |
fee1-dead
commented
Oct 17, 2025
I think this is fine. We're seeing enough wins for more common Rust code ( @bors r+ rollup=never |
bors
commented
Oct 17, 2025
bors
commented
Oct 17, 2025
bors
commented
Oct 18, 2025
☀️ Test successful - checks-actions |
What is this?This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.Comparing f464759 (parent) -> 28fad95 (this PR) Test differencesShow 2 test diffs2 doctest diffs were found. These are ignored, as they are noisy. Test dashboardRun cargo run --manifest-path src/ci/citool/Cargo.toml -- \
test-dashboard 28fad9598975af7734be05116b3c5fc74b720d87 --output-dir test-dashboardAnd then open Job duration changes
How to interpret the job duration changes?Job durations can vary a lot, based on the actual runner instance |
rust-timer
commented
Oct 18, 2025
Finished benchmarking commit (28fad95): comparison URL. Overall result: ❌✅ regressions and improvements - please read the text belowOur benchmarks found a performance regression caused by this PR. Next Steps:
@rustbot label: +perf-regression Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary -0.0%, secondary 0.5%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary -2.0%, secondary -3.3%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 475.372s -> 475.32s (-0.01%) |
lqd
commented
Oct 18, 2025
cranelift-codegen is one of the benchmarks where borrowck takes the longest, is it expected that this change impacts it so negatively? |
Mark-Simulacrum
commented
Oct 21, 2025
I think I'm broadly in agreement with this summary of the results. Definitely would be interested in figuring out why we have the outliers we do, though, and seems plausible there's an opportunity waiting there... |
I was puzzled that #142390 introduces additional computations of CFG traversals: borrowck computes them, right?
It turns out that borrowck clones the MIR body, so doesn't share its cache with other analyses.
This PR:
mir_promotedquery;