# HG changeset patch # User Bryan O'Sullivan # Date 1364849192 25200 # Node ID c1f416e4bc80471d1cdbc58d136b67c98793b832 # Parent 37f8baaf31d2dbec094a582169b61a0ee0c717db perf: add perfdirs command This measures the cost of computing the dirstate's dirs structure, which becomes very expensive in a large working directory. diff -r 37f8baaf31d2 -r c1f416e4bc80 contrib/perf.py --- a/contrib/perf.py Mon Apr 01 15:19:16 2013 -0500 +++ b/contrib/perf.py Mon Apr 01 13:46:32 2013 -0700 @@ -99,6 +99,15 @@ rev in s timer(d) +@command('perfdirs') +def perfdirs(ui, repo): + dirstate = repo.dirstate + 'a' in dirstate + def d(): + dirstate.dirs() + del dirstate._dirs + timer(d) + @command('perfdirstate') def perfdirstate(ui, repo): "a" in repo.dirstate