perf: Do not reevaluate goals on the changes on the very opaques registered by them - #162166
perf: Do not reevaluate goals on the changes on the very opaques registered by them#162166ShoyuVanilla wants to merge 1 commit into
Conversation
This comment has been minimized.
This comment has been minimized.
8b0c378 to
370476a
Compare
|
@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.
perf: Do not reevaluate goals on the changes on the very opaques registered by them
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (b6ebf68): 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 1.1%, secondary 1.8%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary -3.4%, secondary -3.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: 472.928s -> 474.036s (0.23%) |
This comment has been minimized.
This comment has been minimized.
370476a to
1ba212e
Compare
|
@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.
perf: Do not reevaluate goals on the changes on the very opaques registered by them
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (4c748d4): comparison URL. Overall result: ❌✅ regressions and improvements - please read:Benchmarking 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. Next, please: If you can, justify the regressions found in this try perf run in writing along with @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 (secondary 2.6%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (secondary -5.9%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeResults (primary 0.0%, secondary 0.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Bootstrap: 477.112s -> 475.949s (-0.24%) |
|
I'm still getting familiar with this part of the solver and I may be missing something here 🙂 but while following the shared Since this originally came from the r-a slowdown would the corresponding r-a implementation helper need to be added here as well? |
I think we have two almost identical functions here and there that returns the number of opaques, aren't we? Am I missing something? 🤔 BTW I didn't mean to be extra clear on this PR (yet) since this is just an experiment so far, but to elaborate a bit more, this used to be(you could check the previous revision before the force push) closer to the original rust-analyzer attempt, with one difference. The original one sets And it actually improved the perf in opaque-heavy benchmarks(the first perf run). I originally thought that the reason why is what I have written in this PR's description, but I was a bit confused and it wasn't really, because the affected code is not triggered unless the evaluation result is So the force-pushed change was an attempt to make this to match with my original hypothesis, to mark goals returning opaques but nothing other than them as I looked into that more and the actual reason why this made it faster was a bit subtle. It accidentally sidesteps the existing mistakes or some slow paths. It made things faster not because of some design improvements. But I haven't made it clear to details enough yet and that's why this is still a draft with unchanged implementations/descriptions |
Originally written by @cynecx in rust-lang/rust-analyzer#23217 (comment)
Currently we track
StalledOnOpaqueswith the number of opaques when we started to evaluate the goal.This is correct and safe, but it makes the goals normalizes opaques, either by their own or their nested goals, to be evaluated once again b/c the
num_opaques_in_storageis changed by themselves.I think tracking the
num_opaques_in_storagefrom the point we finished to evaluate the goal make sense, because..Projectiongoals for opaques, and they are surely unaffected by skipping reevaluation.