Mercurial > hg
view tests/test-convert-bzr-ghosts.t @ 16414:e8d37b78acfb
parsers: use base-16 trie for faster node->rev mapping
This greatly speeds up node->rev lookups, with results that are
often user-perceptible: for instance, "hg --time log" of the node
associated with rev 1000 on a linux-2.6 repo improves from 0.3
seconds to 0.03. I have not found any instances of slowdowns.
The new perfnodelookup command in contrib/perf.py demonstrates the
speedup more dramatically, since it performs no I/O. For a single
lookup, the new code is about 40x faster.
These changes also prepare the ground for the possibility of further
improving the performance of prefix-based node lookups.
author | Bryan O'Sullivan <bryano@fb.com> |
---|---|
date | Thu, 12 Apr 2012 14:05:59 -0700 |
parents | f84dda152a55 |
children | f2719b387380 |
line wrap: on
line source
$ . "$TESTDIR/bzr-definitions" $ cat > ghostcreator.py <<EOF > import sys > from bzrlib import workingtree > wt = workingtree.WorkingTree.open('.') > > message, ghostrev = sys.argv[1:] > wt.set_parent_ids(wt.get_parent_ids() + [ghostrev]) > wt.commit(message) > EOF ghost revisions $ mkdir test-ghost-revisions $ cd test-ghost-revisions $ bzr init -q source $ cd source $ echo content > somefile $ bzr add -q somefile $ bzr commit -q -m 'Initial layout setup' $ echo morecontent >> somefile $ python ../../ghostcreator.py 'Commit with ghost revision' ghostrev $ cd .. $ hg convert source source-hg initializing destination source-hg repository scanning source... sorting... converting... 1 Initial layout setup 0 Commit with ghost revision $ glog -R source-hg o 1@source "Commit with ghost revision" files: somefile | o 0@source "Initial layout setup" files: somefile