This set of changes brings amending a tip commit on a large repo from 11 seconds down to 4.8 seconds. The riskiest part is the new algorithm to determine which revisions to strip from a revlog.