[PATCH 6 of 7 V6] dirstate: add a C implementation for nonnormalentries

Martin von Zweigbergk martinvonz at google.com
Tue Dec 22 10:32:22 CST 2015


On Tue, Dec 22, 2015 at 8:31 AM Martin von Zweigbergk <martinvonz at google.com>
wrote:

> On Mon, Dec 21, 2015 at 4:38 PM Laurent Charignon <lcharignon at fb.com>
> wrote:
>
>> # HG changeset patch
>> # User Laurent Charignon <lcharignon at fb.com>
>> # Date 1450744036 28800
>> #      Mon Dec 21 16:27:16 2015 -0800
>> # Node ID cc3b2338b18a45db45a2dcab757455c63e6de0d4
>> # Parent  ea469e3797c1ea6c20f3b30efe5ef532279dd3ce
>> dirstate: add a C implementation for nonnormalentries
>>
>> Before this patch, there was only a python version of nonnormalentries.
>> On mozilla-central we have a 10x win by putting this function in C:
>> % python -m timeit -s \
>>         'from mercurial import hg, ui, parsers; \
>>         repo = hg.repository(ui.ui(), "mozilla-central"); \
>>         m = repo.dirstate._map' \
>>         'parsers.nonnormalentries(m)'
>>
>> 100 loops, best of 3: 3.15 msec per loop
>>
>> The python implementation runs in 31ms, a similar test gives:
>> 10 loops, best of 3: 31.7 msec per loop
>>
>> On our big repos, the win is still of 10x with the python implementation
>> running
>> in 350ms and the C implementation running in 30ms.
>
>
> What does the above mean in practice? How much faster does "hg status" get
> in the normal case of a few modified files? (I'm not suggesting you should
> remove the above, but I'm personally more interested in what optimizations
> mean in practice.)
>

Oh, that was in the next patch. Never mind...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20151222/7a550b1d/attachment.html>


More information about the Mercurial-devel mailing list