Patchwork [3,of,3,V3] manifest: increase lrucache from 3 to 4

login
register
mail settings
Submitter Durham Goode
Date Nov. 16, 2013, 8:29 p.m.
Message ID <aadc27ceb73ca151a816.1384633786@dev350.prn1.facebook.com>
Download mbox | patch
Permalink /patch/2994/
State Accepted
Commit f8737bce736a6e8171ec955734aa6a19b8def074
Headers show

Comments

Durham Goode - Nov. 16, 2013, 8:29 p.m.
# HG changeset patch
# User Durham Goode <durham@fb.com>
# Date 1384216512 28800
#      Mon Nov 11 16:35:12 2013 -0800
# Node ID aadc27ceb73ca151a8168e58634bf735c1ac3c64
# Parent  91e01e4b76015511c29b4dbbcc2a73eeba2440b2
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.
Matt Mackall - Nov. 16, 2013, 8:53 p.m.
On Sat, 2013-11-16 at 12:29 -0800, Durham Goode wrote:
> # HG changeset patch
> # User Durham Goode <durham@fb.com>
> # Date 1384216512 28800
> #      Mon Nov 11 16:35:12 2013 -0800
> # Node ID aadc27ceb73ca151a8168e58634bf735c1ac3c64
> # Parent  91e01e4b76015511c29b4dbbcc2a73eeba2440b2
> manifest: increase lrucache from 3 to 4

These are queued for default, thanks.

Patch

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):