[PATCH 0 of 6 v2] speed up hg-add

Joshua Redstone joshua.redstone at fb.com
Tue Jun 26 19:04:37 UTC 2012


This is a second pass at a patch series to speed up hg-add of a single file on a
large repo from about 2.5 seconds down to 0.75 seconds.  It works by introducing
a _sortedfiles property into dirstate and some lazy caching into the case
collision checker.  After the optimization, it looks like about 30% of time (say
0.3 seconds) is spent copying dirstate._map and filtering out entries of type
'r'.  Sorting the resulting list is negligable in time, as is the log-n
searching the list and even the o(n) insertion to update the list (probably
because the constant is so small?).


More information about the Mercurial-devel mailing list