[PATCH] manifest: cache parsed fulltext during find

Siddharth Agarwal sid0 at fb.com
Tue Mar 12 05:46:48 CDT 2013


Yes, I'd drop find and _search altogether.

Bryan O'Sullivan <bos at serpentine.com> wrote:



On Mon, Mar 11, 2013 at 5:25 PM, Durham Goode <durham at fb.com<mailto:durham at fb.com>> wrote:

>From looking at the find() function, it looks like it was written with the
purpose of not parsing the whole manifest.

Yep. It was written back when manifest parsing was performed entirely in Python, and was consequently very slow. About two years later, I wrote the C code for parsing the manifest.

At that point, the need to not parse the manifest was likely no longer an issue, except for those hypothetical people using Mercurial without a C compiler.

 So I worry that this fix will
have a negative affect somewhere else.

I haven't been able to find such an effect. That said, I suspect that manifest.find and manifest._search are entirely unnecessary now (except for the --pure folks), and could be done away with.

If that perf hit is acceptable, we might as well just write find as:

def find(self, node, f):
    mapping = self.read(node)
    return mapping.get(f), mapping.flags(f)

I don't think there is a perf hit, and the above ought to work fine.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20130312/2456980f/attachment.html>


More information about the Mercurial-devel mailing list