[PATCH 2 of 2] dirstate: track otherparent files same as nonnormal

Durham Goode durham at fb.com
Sun Mar 5 19:51:35 EST 2017


On 3/5/17 4:24 PM, Durham Goode wrote:
> # HG changeset patch
> # User Durham Goode <durham at fb.com>
> # Date 1488759650 28800
> #      Sun Mar 05 16:20:50 2017 -0800
> # Node ID f902e85491b50b1d2495fecb6b4ce2c48829ec12
> # Parent  4a751a57ef0682dc3d7e46bdfa67a26b13cd9031
> dirstate: track otherparent files same as nonnormal
>
> Calling dirstate.setparents() is expensive in a large repo because it iterates
> over every file in the dirstate. It does so to undo any merge state or
> otherparent state files. Merge state files are already covered by
> dirstate._nonnormalset, so we just need to track otherparent files in a similar
> manner to avoid the full iteration here.
>
> Fixing this shaves 20-25% off histedit in large repos.
>
> I tested this by adding temporary debug logic to verify that the old files
> processed in the loop matched the new files processed in the loop and running
> the test suite.

Woops, sent this out before doing a final amend.  V2 sent


More information about the Mercurial-devel mailing list