[PATCH] Fix revlog.parseindex
Alexis S. L. Carvalho
alexis at cecm.usp.br
Mon May 15 13:42:50 CDT 2006
Thus spake Chris Mason:
> On Saturday 13 May 2006 14:12, Alexis S. L. Carvalho wrote:
> > diff -r 766c3c852786 -r df4b5d5b2a1b mercurial/revlog.py
> > --- a/mercurial/revlog.py Fri May 12 21:25:58 2006 -0700
> > +++ b/mercurial/revlog.py Sat May 13 15:09:57 2006 -0300
> > @@ -405,19 +405,17 @@ class revlog(object):
> > if n == 0 and self.inlinedata():
> > # cache the first chunk
> > self.chunkcache = (0, data)
> > + if leftover:
> > + data = leftover + data
> > + leftover = None
>
> Sorry for the late reply. The reason why the code wasn't this way initially
> is string duplication. My version duplicates a 64 byte string, this one
> makes two copies of a 64kb string.
OTOH this one removes a conditional from the inner loop.
I did try to benchmark it before sending the patch, but I wasn't able to
measure any significant difference.
Alexis
More information about the Mercurial
mailing list