[PATCH 5 of 5 V2] manifest: increase lrucache from 3 to 4
Durham Goode
durham at fb.com
Wed Nov 13 15:31:06 CST 2013
# HG changeset patch
# User Durham Goode <durham at fb.com>
# Date 1384216512 28800
# Mon Nov 11 16:35:12 2013 -0800
# Node ID 2aacf27a68fd58e9675647612711a18b36023add
# Parent 21a4fec31a1f3bea839058b8fd7d7a85c096542c
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 5.3 seconds to 4.8 seconds.
diff --git a/mercurial/manifest.py b/mercurial/manifest.py
--- a/mercurial/manifest.py
+++ b/mercurial/manifest.py
@@ -30,8 +30,9 @@
class manifest(revlog.revlog):
def __init__(self, opener):
- # we expect to deal with not more than three revs at a time in merge
- self._mancache = util.lrucachedict(3)
+ # we expect to deal with not more than four revs at a time,
+ # during a commit --amend
+ self._mancache = util.lrucachedict(4)
revlog.revlog.__init__(self, opener, "00manifest.i")
def parse(self, lines):
More information about the Mercurial-devel
mailing list