Patchwork [2,of,4] cmdutil: store a local ref to repo.hiddenrevs in getgraphlogrevs

login
register
mail settings
Submitter Siddharth Agarwal
Date Dec. 29, 2012, 12:56 a.m.
Message ID <d518e5bb7e24789992ea.1356742598@sid0x220>
Download mbox | patch
Permalink /patch/324/
State Accepted
Commit 0dcc77b271b93ad6f4a6729d8d8cb8051b7086b0
Headers show

Comments

Siddharth Agarwal - Dec. 29, 2012, 12:56 a.m.
# HG changeset patch
# User Siddharth Agarwal <sid0 at 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).

Patch

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