Mercurial > hg > mercurial-crew-with-dirclash
view tests/test-flags.out @ 879:953ccddd57bd
dirstate walking optimizations
The repo walking code introduces a number of calls to dirstate.map.copy(),
significantly slowing down the walk on large trees. When a list of
files is passed to the walking code, we should only look at map entries
relevant to the file list passed in.
dirstate.filterfiles() is added to return a subset of the dirstate map.
The subset includes in files passed in, and if one of the files requested
is actually a directory, it includes any files inside that directory tree.
This brings the time for hg diff Makefile down from 1.7s to .3s on
a linux kernel repo.
Also, the diff command was unconditionally calling makewalk, leading
to an extra pass through repo.changes. This patch avoids the call
to makewalk when commands.diff isn't given a list of patterns, cutting
the time for hg diff (with no args) in half.
Index: mine/mercurial/hg.py
===================================================================
author | mason@suse.com |
---|---|
date | Fri, 12 Aug 2005 07:10:21 -0800 |
parents | 0902ffece4b4 |
children | 5a034646e472 |
line wrap: on
line source
+ hg init + hg add a b + hg ci -m added a b -d 0 0 + hg init + hg pull ../test1 pulling from ../test1 requesting all changes adding changesets adding manifests adding file changes added 1 changesets with 2 changes to 2 files (run 'hg update' to get a working copy) + hg co + hg ci -m chmod +x a -d 0 0 + hg ci -m a updated -d 0 0 + hg pull ../test2 pulling from ../test2 searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files (run 'hg update' to get a working copy) + hg heads changeset: 2:3ef543305655 tag: tip parent: 0:22a449e20da5 user: test date: Thu Jan 1 00:00:00 1970 summary: chmod +x a changeset: 1:c6ecefc45368 user: test date: Thu Jan 1 00:00:00 1970 summary: a updated + hg history changeset: 2:3ef543305655 tag: tip parent: 0:22a449e20da5 user: test date: Thu Jan 1 00:00:00 1970 summary: chmod +x a changeset: 1:c6ecefc45368 user: test date: Thu Jan 1 00:00:00 1970 summary: a updated changeset: 0:22a449e20da5 user: test date: Thu Jan 1 00:00:00 1970 summary: added a b + hg -v co -m resolving manifests merging a resolving a -rwxr-x--- -rwxr-x---