[PATCH 4 of 8] revlog: more efficient implementation for issnapshot

Boris FELD boris.feld at octobus.net
Fri Dec 21 06:30:14 EST 2018


On 17/12/2018 13:45, Yuya Nishihara wrote:
> On Mon, 17 Dec 2018 12:00:46 +0000, Boris Feld wrote:
>> # HG changeset patch
>> # User Boris Feld <boris.feld at octobus.net>
>> # Date 1545040296 -3600
>> #      Mon Dec 17 10:51:36 2018 +0100
>> # Node ID 9fe9cc49f235311269fd957c49898396ed7bdfc0
>> # Parent  4cafb262b243b02c217fb538165e354f77ce0fd8
>> # EXP-Topic sparse-revlog-corner-cases
>> # Available At https://bitbucket.org/octobus/mercurial-devel/
>> #              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 9fe9cc49f235
>> revlog: more efficient implementation for issnapshot
>>
>> We avoid multiple method calls and tuple creation, this provides a significant
>> speedup in some case:
>>
>> example affected manifest write
>> before: 0.815520s
>> after:  0.487767s (-40%)
>>
>> diff --git a/mercurial/revlog.py b/mercurial/revlog.py
>> --- a/mercurial/revlog.py
>> +++ b/mercurial/revlog.py
>> @@ -1535,11 +1535,17 @@ class revlog(object):
>>          """
>>          if rev == nullrev:
>>              return True
>> -        deltap = self.deltaparent(rev)
>> +        entry = self.index[rev]
>> +        deltap = entry[3]
> Shouldn't it be called a "base" ?

It could be called base. However, the previous code used "deltap". I
would rather not mix the two changes. I can do the modification in
another changeset.

> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


More information about the Mercurial-devel mailing list