##// END OF EJS Templates
perf: add a way to benchmark `dirstate.status`...
marmoute -
r43702:eabc5eec default draft
parent child Browse files
Show More
@@ -760,7 +760,10 b' def perfannotate(ui, repo, f, **opts):'
760
760
761 @command(
761 @command(
762 b'perfstatus',
762 b'perfstatus',
763 [(b'u', b'unknown', False, b'ask status to look for unknown files')]
763 [
764 (b'u', b'unknown', False, b'ask status to look for unknown files'),
765 (b'', b'dirstate', False, b'benchmark the internal dirstate call'),
766 ]
764 + formatteropts,
767 + formatteropts,
765 )
768 )
766 def perfstatus(ui, repo, **opts):
769 def perfstatus(ui, repo, **opts):
@@ -776,7 +779,20 b' def perfstatus(ui, repo, **opts):'
776 # timer(lambda: sum(map(len, repo.dirstate.status(m, [], False, False,
779 # timer(lambda: sum(map(len, repo.dirstate.status(m, [], False, False,
777 # False))))
780 # False))))
778 timer, fm = gettimer(ui, opts)
781 timer, fm = gettimer(ui, opts)
779 timer(lambda: sum(map(len, repo.status(unknown=opts[b'unknown']))))
782 if opts[b'dirstate']:
783 dirstate = repo.dirstate
784 m = scmutil.matchall(repo)
785 unknown = opts[b'unknown']
786
787 def status_dirstate():
788 s = dirstate.status(
789 m, subrepos=[], ignored=False, clean=False, unknown=unknown
790 )
791 sum(map(len, s))
792
793 timer(status_dirstate)
794 else:
795 timer(lambda: sum(map(len, repo.status(unknown=opts[b'unknown']))))
780 fm.end()
796 fm.end()
781
797
782
798
@@ -248,6 +248,7 b' perfstatus'
248 $ hg perfrevset 'all()'
248 $ hg perfrevset 'all()'
249 $ hg perfstartup
249 $ hg perfstartup
250 $ hg perfstatus
250 $ hg perfstatus
251 $ hg perfstatus --dirstate
251 $ hg perftags
252 $ hg perftags
252 $ hg perftemplating
253 $ hg perftemplating
253 $ hg perfvolatilesets
254 $ hg perfvolatilesets
General Comments 0
You need to be logged in to leave comments. Login now