From patchwork Fri Mar 29 01:22:44 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [2,of,6] perf: add perfdirs command From: Bryan O'Sullivan X-Patchwork-Id: 1209 Message-Id: <42348ed8d9a218eee27b.1364520164@australite.local> To: mercurial-devel@selenic.com Date: Thu, 28 Mar 2013 18:22:44 -0700 # HG changeset patch # User Bryan O'Sullivan # Date 1364520149 25200 # Thu Mar 28 18:22:29 2013 -0700 # Node ID 42348ed8d9a218eee27b40b48d368aed552c1452 # Parent d6bb127c3380f9ee622703d87bae4bc1fd0f8421 perf: add perfdirs command This measures the cost of computing the dirstate's dirs structure, which becomes very expensive in a large working directory. diff --git a/contrib/perf.py b/contrib/perf.py --- a/contrib/perf.py +++ b/contrib/perf.py @@ -99,6 +99,15 @@ def perfancestorset(ui, repo, revset): rev in s timer(d) +@command('perfdirs') +def perfdirs(ui, repo): + dirstate = repo.dirstate + 'a' in dirstate + def d(): + dirstate.iterdirs() + del dirstate._dirs + timer(d) + @command('perfdirstate') def perfdirstate(ui, repo): "a" in repo.dirstate