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

login
register
mail settings
Submitter Durham Goode
Date Nov. 12, 2013, 4:14 a.m.
Message ID <8df5693d385b21487fc0.1384229667@dev350.prn1.facebook.com>
Download mbox | patch
Permalink /patch/2922/
State Superseded
Commit f8737bce736a6e8171ec955734aa6a19b8def074
Headers show

Comments

Durham Goode - Nov. 12, 2013, 4:14 a.m.
# HG changeset patch
# User Durham Goode <durham@fb.com>
# Date 1384216512 28800
#      Mon Nov 11 16:35:12 2013 -0800
# Node ID 8df5693d385b21487fc08c98456219d07074d950
# Parent  bd7f7d542d7417d2784b577d3e9a7a55476e5f54
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.
Siddharth Agarwal - Nov. 12, 2013, 6:14 p.m.
On 11/11/2013 08:14 PM, 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 8df5693d385b21487fc08c98456219d07074d950
> # Parent  bd7f7d542d7417d2784b577d3e9a7a55476e5f54
> 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
> @@ -31,7 +31,7 @@
>   class manifest(revlog.revlog):
>       def __init__(self, opener):
>           # we expect to deal with not more than three revs at a time in merge

This comment needs to be fixed.

> -        self._mancache = util.lrucachedict(3)
> +        self._mancache = util.lrucachedict(4)
>           revlog.revlog.__init__(self, opener, "00manifest.i")
>   
>       def parse(self, lines):
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel

Patch

diff --git a/mercurial/manifest.py b/mercurial/manifest.py
--- a/mercurial/manifest.py
+++ b/mercurial/manifest.py
@@ -31,7 +31,7 @@ 
 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)
+        self._mancache = util.lrucachedict(4)
         revlog.revlog.__init__(self, opener, "00manifest.i")
 
     def parse(self, lines):