Mercurial > hg
comparison contrib/perf.py @ 32531:7236facefd4f
perf: rename perfrevlog to perfrevlogrevisions
We have a couple of commands beginning with "perfrevlog." The
actual "perfrevlog" command actually measures resolving the fulltext
of multiple revisions. So let's rename it to reflect what it actually
does.
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Sun, 28 May 2017 10:56:28 -0700 |
parents | ad37c569ec81 |
children | e4f514627514 |
comparison
equal
deleted
inserted
replaced
32530:3f0936b2cea9 | 32531:7236facefd4f |
---|---|
855 ui.popbuffer() | 855 ui.popbuffer() |
856 title = 'diffopts: %s' % (diffopt and ('-' + diffopt) or 'none') | 856 title = 'diffopts: %s' % (diffopt and ('-' + diffopt) or 'none') |
857 timer(d, title) | 857 timer(d, title) |
858 fm.end() | 858 fm.end() |
859 | 859 |
860 @command('perfrevlog', revlogopts + formatteropts + | 860 @command('perfrevlogrevisions', revlogopts + formatteropts + |
861 [('d', 'dist', 100, 'distance between the revisions'), | 861 [('d', 'dist', 100, 'distance between the revisions'), |
862 ('s', 'startrev', 0, 'revision to start reading at'), | 862 ('s', 'startrev', 0, 'revision to start reading at'), |
863 ('', 'reverse', False, 'read in reverse')], | 863 ('', 'reverse', False, 'read in reverse')], |
864 '-c|-m|FILE') | 864 '-c|-m|FILE') |
865 def perfrevlog(ui, repo, file_=None, startrev=0, reverse=False, **opts): | 865 def perfrevlogrevisions(ui, repo, file_=None, startrev=0, reverse=False, |
866 **opts): | |
866 """Benchmark reading a series of revisions from a revlog. | 867 """Benchmark reading a series of revisions from a revlog. |
867 | 868 |
868 By default, we read every ``-d/--dist`` revision from 0 to tip of | 869 By default, we read every ``-d/--dist`` revision from 0 to tip of |
869 the specified revlog. | 870 the specified revlog. |
870 | 871 |
871 The start revision can be defined via ``-s/--startrev``. | 872 The start revision can be defined via ``-s/--startrev``. |
872 """ | 873 """ |
873 rl = cmdutil.openrevlog(repo, 'perfrevlog', file_, opts) | 874 rl = cmdutil.openrevlog(repo, 'perfrevlogrevisions', file_, opts) |
874 rllen = getlen(ui)(rl) | 875 rllen = getlen(ui)(rl) |
875 | 876 |
876 def d(): | 877 def d(): |
877 rl.clearcaches() | 878 rl.clearcaches() |
878 | 879 |
905 data needs to be read and decompressed or compressed and written. | 906 data needs to be read and decompressed or compressed and written. |
906 | 907 |
907 This command measures the time it takes to read+decompress and recompress | 908 This command measures the time it takes to read+decompress and recompress |
908 chunks in a revlog. It effectively isolates I/O and compression performance. | 909 chunks in a revlog. It effectively isolates I/O and compression performance. |
909 For measurements of higher-level operations like resolving revisions, | 910 For measurements of higher-level operations like resolving revisions, |
910 see ``perfrevlog`` and ``perfrevlogrevision``. | 911 see ``perfrevlogrevisions`` and ``perfrevlogrevision``. |
911 """ | 912 """ |
912 rl = cmdutil.openrevlog(repo, 'perfrevlogchunks', file_, opts) | 913 rl = cmdutil.openrevlog(repo, 'perfrevlogchunks', file_, opts) |
913 | 914 |
914 # _chunkraw was renamed to _getsegmentforrevs. | 915 # _chunkraw was renamed to _getsegmentforrevs. |
915 try: | 916 try: |