[borrowck] Do an in-place update of SCCs rather than recomputing#155931
[borrowck] Do an in-place update of SCCs rather than recomputing#155931amandasystems wants to merge 1 commit intorust-lang:mainfrom
Conversation
|
rustbot has assigned @jdonszelmann. Use Why was this reviewer chosen?The reviewer was selected based on:
|
This comment has been minimized.
This comment has been minimized.
|
@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.
[borrowck] Do an in-place update of SCCs rather than recomputing
Exploit some of the nice properties of `'static` in the constraint graph to avoid doing a full recomputation of SCC components when adding `: 'static` outlives. Notably, this relies on the fact that adding any `'r: 'static` will simply remove `'r`'s SCC as well as any of its predecessors from the set of SCCs, since they now all participate in a cycle with `'static` (which outlives everything and thus has an edge into every region).
ca79010 to
1593a7d
Compare
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (6dbb4d3): 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.2%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (secondary 3.2%)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: 487.089s -> 490.144s (0.63%) |
|
Wow. Ok, then I don't see any point in bothering and I can finally lay this intrusive idea to rest. Thanks for coming to my TED talk! |
|
Probably what you really want is a specialised SCC construction for the outlives graph. That would allow tacking on all the extra annotations (and representatives etc) in a nicer way. It would also allow handling the extra :static constraints during construction. 'static can also be handled as a special case without having to add every SCC as a successor to it explicitly. However, I suspect the potential gains are at best very small for what is a large refactor. I'm leaving this idea here for anyone who wants to investigate it. Ping me if you do, I'd like to see how it pans out! |
Exploit some of the nice properties of
'staticin the constraint graph to avoid doing a full recomputation of SCC components when adding: 'staticoutlives.Notably, this relies on the fact that adding any
'r: 'staticwill simply remove'r's SCC as well as any of its predecessors from the set of SCCs, since they now all participate in a cycle with'static(which outlives everything and thus has an edge into every region).r? @lcnr
(who may or may not want to delegate this)
This almost entirely a performance thing so it wants a perf run, but it actually makes some of the code more straightforward.