comparison mercurial/manifest.py @ 20075:f8737bce736a

manifest: increase lrucache from 3 to 4 During a commit amend there are 4 manifests being handled: - original commit - temporary commit - amended commit - merge base This causes a manifest cache miss which hurts perf on large repos. On a large repo, this fix causes amend to go from 6 seconds to 5.5 seconds.
author Durham Goode <durham@fb.com>
date Mon, 11 Nov 2013 16:35:12 -0800
parents 40b4b1f9b7a0
children 090dcaaf3fff
comparison
equal deleted inserted replaced
20074:5fc2ae1c631b 20075:f8737bce736a
28 def flagsdiff(self, d2): 28 def flagsdiff(self, d2):
29 return dicthelpers.diff(self._flags, d2._flags, "") 29 return dicthelpers.diff(self._flags, d2._flags, "")
30 30
31 class manifest(revlog.revlog): 31 class manifest(revlog.revlog):
32 def __init__(self, opener): 32 def __init__(self, opener):
33 # we expect to deal with not more than three revs at a time in merge 33 # we expect to deal with not more than four revs at a time,
34 self._mancache = util.lrucachedict(3) 34 # during a commit --amend
35 self._mancache = util.lrucachedict(4)
35 revlog.revlog.__init__(self, opener, "00manifest.i") 36 revlog.revlog.__init__(self, opener, "00manifest.i")
36 37
37 def parse(self, lines): 38 def parse(self, lines):
38 mfdict = manifestdict() 39 mfdict = manifestdict()
39 parsers.parse_manifest(mfdict, mfdict._flags, lines) 40 parsers.parse_manifest(mfdict, mfdict._flags, lines)