Show More
@@ -760,7 +760,10 b' def perfannotate(ui, repo, f, **opts):' | |||
|
760 | 760 | |
|
761 | 761 | @command( |
|
762 | 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 | 767 | + formatteropts, |
|
765 | 768 | ) |
|
766 | 769 | def perfstatus(ui, repo, **opts): |
@@ -776,7 +779,20 b' def perfstatus(ui, repo, **opts):' | |||
|
776 | 779 | # timer(lambda: sum(map(len, repo.dirstate.status(m, [], False, False, |
|
777 | 780 | # False)))) |
|
778 | 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 | 796 | fm.end() |
|
781 | 797 | |
|
782 | 798 |
General Comments 0
You need to be logged in to leave comments.
Login now