[PATCH] manifest: cache parsed fulltext during find

Bryan O'Sullivan bos at serpentine.com
Mon Mar 11 23:57:28 CDT 2013


On Mon, Mar 11, 2013 at 5:25 PM, Durham Goode <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/20130311/c3ff4858/attachment.html>


More information about the Mercurial-devel mailing list