[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mercurial-devel
Subject:    [PATCH 2 of 4] cmdutil: store a local ref to repo.hiddenrevs in getgraphlogrevs
From:       Siddharth Agarwal <sid0 () fb ! com>
Date:       2012-12-29 0:56:38
Message-ID: d518e5bb7e24789992ea.1356742598 () sid0x220
[Download RAW message or body]

# HG changeset patch
# User Siddharth Agarwal <sid0@fb.com>
# Date 1356740676 28800
# Node ID d518e5bb7e24789992eacb6a07c6eb74308413da
# Parent  794951c412ac05bad45cf6aa3f91b64f20f8b539
cmdutil: store a local ref to repo.hiddenrevs in getgraphlogrevs

On a repository with over 400,000 changesets, this speeds graphlog up by
around 0.03 seconds (~20% with a small limit).

diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -1453,7 +1453,8 @@ def getgraphlogrevs(repo, pats, opts):
     if not opts.get('hidden'):
         # --hidden is still experimental and not worth a dedicated revset
         # yet. Fortunately, filtering revision number is fast.
-        revs = (r for r in revs if r not in repo.hiddenrevs)
+        hiddenrevs = repo.hiddenrevs
+        revs = (r for r in revs if r not in hiddenrevs)
     else:
         revs = iter(revs)
     return revs, expr, filematcher
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@selenic.com
http://selenic.com/mailman/listinfo/mercurial-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic