Mercurial > hg
changeset 19715:1aab406be57c
revlog._chunks: inline getchunk
We do this in a somewhat hacky way, relying on the fact that our sole caller
preloads the cache right before calling us. An upcoming patch will make this
more sensible.
For a 20 MB manifest with a delta chain of > 40k, perfmanifest goes from 0.49
seconds to 0.46.
author | Siddharth Agarwal <sid0@fb.com> |
---|---|
date | Fri, 06 Sep 2013 22:57:51 -0700 |
parents | 0e07c0b5fb1c |
children | e17976978ee4 |
files | mercurial/revlog.py |
diffstat | 1 files changed, 5 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/revlog.py Sat Sep 07 12:42:46 2013 -0700 +++ b/mercurial/revlog.py Fri Sep 06 22:57:51 2013 -0700 @@ -863,17 +863,20 @@ length = self.length inline = self._inline iosize = self._io.size - getchunk = self._getchunk + buffer = util.buffer l = [] ladd = l.append + # XXX assume for now that chunkcache is preloaded + offset, data = self._chunkcache + for rev in revs: chunkstart = start(rev) if inline: chunkstart += (rev + 1) * iosize chunklength = length(rev) - ladd(decompress(getchunk(chunkstart, chunklength))) + ladd(decompress(buffer(data, chunkstart - offset, chunklength))) return l