Conversation
|
r? @mejrs rustbot has assigned @mejrs. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
@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.
skip reachable_set calculation during metadata encoding when unused
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (4956747): comparison URL. Overall result: ✅ improvements - no action neededBenchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf. @bors rollup=never rustc-perf 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.5%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary -5.1%, secondary 2.3%)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: 484.651s -> 483.527s (-0.23%) |
| fn should_encode_mir( | ||
| tcx: TyCtxt<'_>, | ||
| reachable_set: &LocalDefIdSet, | ||
| reachable_set: Option<&LocalDefIdSet>, |
There was a problem hiding this comment.
It's non-obvious to me what this Option means in terms of should_encode_mir. In the context of this diff, it's clear that it's Some if and only if should_codegen(). But otherwise it doesn't seem obvious (without carefully reading the implementation) that passing None will mean a blanket "no, don't encode MIR for LLVM" for a lot of Defs (other optional parameters are sometimes used for "extra info that gives a more precise result if you have it"). I'm not even sure if this should be an Option or whether it's better to just pass an empty LocalDefIdSet.
Some options for improving this:
- Inside this function,
assert!thatshould_codegen()agrees withreachable_set.is_some() - Amend the above doc comment to explain the meaning of optional
reachable_set - As mentioned, don't use
Optionbut instead construct an empty reachable set at the call site that would've passedNone(and leave a comment there explaining what it means).
More radical: we could change the reachable_set query itself to return an empty set when we shouldn't codegen. I think this is defensible because the query basically answers "local items whose compiled code or runtime MIR may be needed for codegen that happens in downstream crates" and if !should_codegen() that's none of them. I'm not yet 100% sure about this, it might have bad side effects I don't see, but at least the query is currently only used for should_encode_mir and in codegen backends.
There was a problem hiding this comment.
Kept it as an option, but documented it and added the assert
|
Reminder, once the PR becomes ready for a review, use |
fe71934 to
bfe6e1a
Compare
|
@rustbot ready |
There was a problem hiding this comment.
I'm still not sure if I like the Option, but with documentation + assert it's not a maintainability hazard or likely source of bugs, so it's fine. Maybe I'll try to pitch the "empty reachable_set in check builds" idea to another reviewer as a follow up PR.
Thank you!
@bors r+
This comment has been minimized.
This comment has been minimized.
…na-kruppe skip reachable_set calculation during metadata encoding when unused
|
The job Click to see the possible cause of the failure (guessed by this bot) |
|
💔 Test for fb1d0c7 failed: CI. Failed job:
|
|
@bors retry |
This comment has been minimized.
This comment has been minimized.
…na-kruppe skip reachable_set calculation during metadata encoding when unused
|
The job Click to see the possible cause of the failure (guessed by this bot) |
|
💔 Test for 0b6b082 failed: CI. Failed job:
|
This comment has been minimized.
This comment has been minimized.
skip reachable_set calculation during metadata encoding when unused try-job: test-aarch64-msvc-1
|
@bors p=6 |
This comment has been minimized.
This comment has been minimized.
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 4de0e38 (parent) -> fd4400d (this PR) Test differencesShow 6 test diffs6 doctest diffs were found. These are ignored, as they are noisy. Test dashboardRun cargo run --manifest-path src/ci/citool/Cargo.toml -- \
test-dashboard fd4400dce238d263ff4239ac9eb902cb9547daf2 --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 |
|
Finished benchmarking commit (fd4400d): comparison URL. Overall result: ✅ improvements - no action needed@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 -2.5%, secondary -3.7%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary -4.0%)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: 483.729s -> 485.883s (0.45%) |
View all comments