Less duplication in activate #6967
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
One of the "background context" things I re-explained in #6919 (comment) is why we have checks in
RemainingCandidates::next
and inflag_activated
. "Why the duplication? Because cloning aBacktrackFrame
is more expensive than doing the work twice." But thanks to a lot of work, andim.rs
, the clone is now not so bad.This PR attempts to go all in on removing this duplication. Anything to simplify the resolver is good! But, this removes or hamstrings several important optimizations that make NOP builds fast. Specifically #5132 will kick in far less often. Alex, can you look at the times after/before this PR on some larger projects? You have seen this be slow with
perf record ./x.py build
before, but servo or cargo may be easy and interesting.Note that Master is at "Fast but duplicated" and this PR may be at "Slow but clean", the best solution may be somewhere in between.