Performance issues when merging branches (1000+ files being merged takes 75~ seconds)
Peter Arrenbrecht
peter.arrenbrecht at gmail.com
Fri Jun 18 02:28:10 CDT 2010
On Thu, Jun 17, 2010 at 10:33 PM, Peter Arrenbrecht
<peter.arrenbrecht at gmail.com> wrote:
> On Thu, Jun 17, 2010 at 10:22 PM, Vishakh Harikumar <vsh426 at gmail.com> wrote:
>> On Thu, Jun 17, 2010 at 9:08 PM, Peter Arrenbrecht
>> <peter.arrenbrecht at gmail.com> wrote:
>>>
>>> OK, key issue is that filectx.ancestor always recomputes the cset
>>> ancestor. This is unnecessary. Shall look into fixing this later.
>>> -parren
>>
>> Since the same ctx are used everytime, caching it
>> results in time:
>> real 0m10.231s
>> user 0m5.650s
>> sys 0m1.480s
>>
>> diff --git a/mercurial/context.py b/mercurial/context.py
>> --- a/mercurial/context.py
>> +++ b/mercurial/context.py
>> @@ -173,6 +173,7 @@
>> return filectx(self._repo, path, fileid=fileid,
>> changectx=self, filelog=filelog)
>>
>> + @util.lrucachefunc
>> def ancestor(self, c2):
>> """
>> return the ancestor context of self and c2
>>
>> I dont know if the change affects anything else.
>
> Neat, though personally I'd rather fix it by passing the cset ancestor
> into filectx.ancestor explicitly.
Down to about 4 secs (on SSD) by delaying mergestate._write during applyupdates.
-parren
More information about the Mercurial-devel
mailing list