tests/test-mq-qsave.t
author Siddharth Agarwal <sid0@fb.com>
Tue, 31 Mar 2015 19:29:39 -0700
changeset 24560 b38bcf18993c
parent 12324 b701610f6c56
child 49585 55c6ebd11cb9
permissions -rw-r--r--
dirstate.walk: don't keep track of normalized files in parallel Rev 2bb13f2b778c changed the semantics of the work list to store (normalized, non-normalized) pairs. All the tuple creation and destruction hurts perf: on a large repo on OS X, 'hg status' went from 3.62 seconds to 3.78. It also is unnecessary in most cases: - it is clearly unnecessary on case-sensitive filesystems. - it is also unnecessary when filenames have been read off of disk rather than being supplied by the user. The only case where the non-normalized case is required at all is when the file is unknown. To eliminate most of the perf cost, keep trace of whether the directory needs to be normalized at all with a boolean called 'alreadynormed'. Pay the cost of directory normalization only when necessary. For the above large repo, 'hg status' goes to 3.63 seconds.

  $ echo "[extensions]" >> $HGRCPATH
  $ echo "mq=" >> $HGRCPATH

  $ hg init

  $ echo 'base' > base
  $ hg ci -Ambase
  adding base

  $ hg qnew -mmqbase mqbase

  $ hg qsave
  $ hg qrestore 2
  restoring status: hg patches saved state