Show More
@@ -1015,6 +1015,7 b' def perfignore(ui, repo, **opts):' | |||||
1015 |
|
1015 | |||
1016 | @command(b'perfindex', [ |
|
1016 | @command(b'perfindex', [ | |
1017 | (b'', b'rev', b'', b'revision to be looked up (default tip)'), |
|
1017 | (b'', b'rev', b'', b'revision to be looked up (default tip)'), | |
|
1018 | (b'', b'no-lookup', None, b'do not revision lookup post creation'), | |||
1018 | ] + formatteropts) |
|
1019 | ] + formatteropts) | |
1019 | def perfindex(ui, repo, **opts): |
|
1020 | def perfindex(ui, repo, **opts): | |
1020 | """benchmark index creation time followed by a lookup |
|
1021 | """benchmark index creation time followed by a lookup | |
@@ -1029,7 +1030,9 b' def perfindex(ui, repo, **opts):' | |||||
1029 | opts = _byteskwargs(opts) |
|
1030 | opts = _byteskwargs(opts) | |
1030 | timer, fm = gettimer(ui, opts) |
|
1031 | timer, fm = gettimer(ui, opts) | |
1031 | mercurial.revlog._prereadsize = 2**24 # disable lazy parser in old hg |
|
1032 | mercurial.revlog._prereadsize = 2**24 # disable lazy parser in old hg | |
1032 |
if opts[b' |
|
1033 | if opts[b'no_lookup']: | |
|
1034 | n = None | |||
|
1035 | elif opts[b'rev'] is None: | |||
1033 | n = repo[b"tip"].node() |
|
1036 | n = repo[b"tip"].node() | |
1034 | else: |
|
1037 | else: | |
1035 | rev = scmutil.revsingle(repo, opts[b'rev']) |
|
1038 | rev = scmutil.revsingle(repo, opts[b'rev']) | |
@@ -1044,7 +1047,8 b' def perfindex(ui, repo, **opts):' | |||||
1044 | clearchangelog(unfi) |
|
1047 | clearchangelog(unfi) | |
1045 | def d(): |
|
1048 | def d(): | |
1046 | cl = makecl(unfi) |
|
1049 | cl = makecl(unfi) | |
1047 | cl.rev(n) |
|
1050 | if n is not None: | |
|
1051 | cl.rev(n) | |||
1048 | timer(d, setup=setup) |
|
1052 | timer(d, setup=setup) | |
1049 | fm.end() |
|
1053 | fm.end() | |
1050 |
|
1054 |
General Comments 0
You need to be logged in to leave comments.
Login now