D7665: dirstate: when calling rebuild(), avoid some N^2 codepaths
spectral (Kyle Lippincott)
phabricator at mercurial-scm.org
Fri Dec 13 20:27:31 EST 2019
spectral added inline comments.
> martinvonz wrote in dirstate.py:611-620
> How slow? Specifically, how much slower (in percent, or dB, or whatever) is it compared to not converting to a set? I wonder if it's worth the code. `hg debugrebuilddirstate` should be a very rare operation.
With 1 file in changedfiles and 200k files in allfiles, approximately 15x slower. That said, it's a little over 1.5ms in the old version, so in absolute terms this isn't a big difference until you get really huge repos. I haven't really investigated when changedfiles is not None, if it's just for `hg debugrebuilddirstate --minimal`, I agree this isn't worth the complexity, but it looks like mq, strip, and absorb all call rebuild in some cases, and strip and absorb will pass in a list of files. Unsure if that changes things materially, though.
CHANGES SINCE LAST ACTION
To: spectral, #hg-reviewers
Cc: martinvonz, mercurial-devel
More information about the Mercurial-devel