optimize the way that loans are killed in borrowck dataflow #50934
Labels
NLL-performant
Working towards the "performance is good" goal
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Profiling reveals that
kill_loans_out_of_scope_at_location
is a pretty major hot spot. It is pretty naive right now: for each point, it iterates over all borrows to check if that point is included. In fact, it seems to do that twice (@davidtwco opened #50891 to deal with that).I am not sure the best way to handle this computation. One option that is not theoretically better but seems likely to be much better in practice would be:
'a
:'a
, end the walk, but addB
tokill
set for PThis is still O(n^2), but I think it seems likely to be much better in practice, and I can't think of a better way.
The text was updated successfully, but these errors were encountered: