# HG changeset patch # User Pierre-Yves David # Date 1496856131 -3600 # Node ID 2b0a8b0f343556df416bea749140cda86a0a1b05 # Parent e36569bd9e289ae55c1accdde85f7e43577367dd perf: add a perfbookmarks command A new command dedicated to benchmark of bookmark initialization. diff -r e36569bd9e28 -r 2b0a8b0f3435 contrib/perf.py --- a/contrib/perf.py Tue May 23 02:27:41 2017 +0200 +++ b/contrib/perf.py Wed Jun 07 18:22:11 2017 +0100 @@ -467,6 +467,16 @@ timer(d) fm.end() +@command('perfbookmarks', formatteropts) +def perfbookmarks(ui, repo, **opts): + """benchmark parsing bookmarks from disk to memory""" + timer, fm = gettimer(ui, opts) + def d(): + clearfilecache(repo, '_bookmarks') + repo._bookmarks + timer(d) + fm.end() + @command('perfchangegroupchangelog', formatteropts + [('', 'version', '02', 'changegroup version'), ('r', 'rev', '', 'revisions to add to changegroup')]) diff -r e36569bd9e28 -r 2b0a8b0f3435 tests/test-contrib-perf.t --- a/tests/test-contrib-perf.t Tue May 23 02:27:41 2017 +0200 +++ b/tests/test-contrib-perf.t Wed Jun 07 18:22:11 2017 +0100 @@ -51,6 +51,8 @@ (no help text available) perfannotate (no help text available) perfbdiff benchmark a bdiff between revisions + perfbookmarks + benchmark parsing bookmarks from disk to memory perfbranchmap benchmark the update of a branchmap perfcca (no help text available) @@ -122,6 +124,7 @@ $ hg perfannotate a $ hg perfbdiff -c 1 $ hg perfbdiff --alldata 1 + $ hg perfbookmarks $ hg perfbranchmap $ hg perfcca $ hg perfchangegroupchangelog