From patchwork Fri Apr 5 03:39:49 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [1,of,2] perf: add a command to test copies.pathcopies perf From: Siddharth Agarwal X-Patchwork-Id: 1255 Message-Id: To: mercurial-devel@selenic.com Date: Thu, 04 Apr 2013 20:39:49 -0700 # HG changeset patch # User Siddharth Agarwal # Date 1365133006 25200 # Thu Apr 04 20:36:46 2013 -0700 # Node ID d59b8e8a9294d40dfc04e6fe8c295fa05d5a7e40 # Parent 80cd52ed9dafc736b832c6238e9c1bfc7701acba perf: add a command to test copies.pathcopies perf An upcoming patch will improve the performance of this function, and this command will be used to demonstrate that improvement. diff --git a/contrib/perf.py b/contrib/perf.py --- a/contrib/perf.py +++ b/contrib/perf.py @@ -2,7 +2,7 @@ '''helper extension to measure performance''' from mercurial import cmdutil, scmutil, util, match, commands, obsolete -from mercurial import repoview, branchmap, merge +from mercurial import repoview, branchmap, merge, copies import time, os, sys cmdtable = {} @@ -158,6 +158,14 @@ def perfmergecalculate(ui, repo, rev): acceptremote=True) timer(d) +@command('perfpathcopies', [], "REV REV") +def perfpathcopies(ui, repo, rev1, rev2): + ctx1 = scmutil.revsingle(repo, rev1, rev1) + ctx2 = scmutil.revsingle(repo, rev2, rev2) + def d(): + copies.pathcopies(ctx1, ctx2) + timer(d) + @command('perfmanifest') def perfmanifest(ui, repo): def d():