[PATCH 2 of 2] treemanifest: speed up 4x tree to flat manifest conversion

Martin von Zweigbergk martinvonz at google.com
Fri Feb 5 12:09:20 EST 2016


On Fri, Feb 5, 2016 at 7:44 AM, Augie Fackler <raf at durin42.com> wrote:
> On Thu, Feb 04, 2016 at 07:38:45PM +0000, Laurent Charignon wrote:
>> We don't currently have commands relying directly on that but I
>> assume that it will be useful if we want to have a server with tree
>> manifest supporting old clients with flat manifest.
>
> That's not possible, is it? Treemanifests have a different sha1 than
> flatmanifests, so you can't change between them without breaking
> clients.

It seems that way to me too. If there's some interesting migration
path that would use this code path, I'm happy to hear about it.

I was talking to Laurent yesterday. He's also working on moving the
treemanifest code into C and already had some promising stats (I'll
let him share them when he's comfortable doing so). I think that's the
right path to go.

I'm reluctant to take these patches for a piece of code that's not
been shown to be called from anywhere (it exists so one can manually
change _treeinmem to True and make sure the entire test suite still
passes). I don't think the patch makes it the code much less readable,
but again, if the code is not used, I don't care at all about making
it fast. Especially patch 1/2 adds unnecessary code in that case.
Obviously, if the code can be shown to be used, I'm happy to
reconsider.

Laurent, do you agree with dropping these patches?

>> I was just playing around with tree manifest doing some conversions
>> and noticed that it was taking a very long time to call that method.
>> The original code was going through the tree manifest hierarchy 3
>> times(filename, flag and node) when only once was needed: it was a
>> low hanging fruit for performance.
>
> Does it also help 'hg convert' going from tree to flat?

It doesn't seem like it. I don't know how 'hg convert' works, but it
seems to be using manifestdict in this scenario.


More information about the Mercurial-devel mailing list