# HG changeset patch # User Boris Feld # Date 1548445999 18000 # Node ID ab6d1f82be32dbeef7981f3e10b84c5ea85698e0 # Parent e2e815e3c4ae9ed9dcecf846560d1d43f27afe2e perf: move cache clearing in the `setup` step of `perfheads` The cache clearing is pretty fast, but this seems more "correct". diff -r e2e815e3c4ae -r ab6d1f82be32 contrib/perf.py --- a/contrib/perf.py Fri Jan 25 18:22:02 2019 -0500 +++ b/contrib/perf.py Fri Jan 25 14:53:19 2019 -0500 @@ -539,10 +539,11 @@ opts = _byteskwargs(opts) timer, fm = gettimer(ui, opts) cl = repo.changelog + def s(): + clearcaches(cl) def d(): len(cl.headrevs()) - clearcaches(cl) - timer(d) + timer(d, setup=s) fm.end() @command(b'perftags', formatteropts+