[PATCH 1 of 5 V5] dirstate: rename the dirstate parsing and packing methods

Yuya Nishihara yuya at tcha.org
Sun Dec 20 01:54:14 CST 2015


On Sat, 19 Dec 2015 19:06:32 +0000, Durham Goode wrote:
> On 12/19/15, 9:34 AM, "Laurent Charignon" <lcharignon at fb.com> wrote:
> >I can reproduce Durham's number on our large repos with Yuya's python code:
> >~350ms for building the map.
> >However, it looks like computing the non-normal map in C on the same big
> >repo would cost ~20ms, that's a big win, so, I will follow Matt's plan!
> 
> Any idea why it's so much cheaper to build the non-normalmap than the entire
> dirstate?  It's iterating over the same data right?  Perhaps it's because
> we're building a smaller collection (in which case, are we pre-sizing the
> dict correctly when building the dirstate?)

I guess that is because we can avoid most of PyObject creation and access if
we run the loop in C.

BTW, my benchmark wasn't good because HGMODULEPOLICY=py changed the type of
underlying data. But the order of magnitude was the same.

Anyway, the latest Matt's idea will be better as it will avoid creation of
10M dirstatetuple items, I think.


More information about the Mercurial-devel mailing list