##// END OF EJS Templates
parsers: a C implementation of the new ancestors algorithm...
parsers: a C implementation of the new ancestors algorithm The performance of both the old and new Python ancestor algorithms depends on the number of revs they need to traverse. Although the new algorithm performs far better than the old when revs are numerically and topologically close, both algorithms become slow under other circumstances, taking up to 1.8 seconds to give answers in a Linux kernel repo. This C implementation of the new algorithm is a fairly straightforward transliteration. The only corner case of interest is that it raises an OverflowError if the number of GCA candidates found during the first pass is greater than 24, to avoid the dual perils of fixnum overflow and trying to allocate too much memory. (If this exception is raised, the Python implementation is used instead.) Performance numbers are good: in a Linux kernel repo, time for "hg debugancestors" on two distant revs (24bf01de7537 and c2a8808f5943) is as follows: Old Python: 0.36 sec New Python: 0.42 sec New C: 0.02 sec For a case where the new algorithm should perform well: Old Python: 1.84 sec New Python: 0.07 sec New C: measures as zero when using --time (This commit includes a paranoid cross-check to ensure that the Python and C implementations give identical answers. The above performance numbers were measured with that check disabled.)
Bryan O'Sullivan -
r18988:5bae9367 default
Show More
Name Size Modified Last Commit Author
/ mercurial
help
hgweb
httpclient
pure
templates
__init__.py Loading ...
ancestor.py Loading ...
archival.py Loading ...
base85.c Loading ...
bdiff.c Loading ...
bookmarks.py Loading ...
branchmap.py Loading ...
bundlerepo.py Loading ...
byterange.py Loading ...
changegroup.py Loading ...
changelog.py Loading ...
cmdutil.py Loading ...
commands.py Loading ...
commandserver.py Loading ...
config.py Loading ...
context.py Loading ...
copies.py Loading ...
dagparser.py Loading ...
dagutil.py Loading ...
demandimport.py Loading ...
dicthelpers.py Loading ...
diffhelpers.c Loading ...
dirs.c Loading ...
dirstate.py Loading ...
discovery.py Loading ...
dispatch.py Loading ...
encoding.py Loading ...
error.py Loading ...
exewrapper.c Loading ...
extensions.py Loading ...
fancyopts.py Loading ...
filelog.py Loading ...
filemerge.py Loading ...
fileset.py Loading ...
formatter.py Loading ...
graphmod.py Loading ...
hbisect.py Loading ...
help.py Loading ...
hg.py Loading ...
hook.py Loading ...
httpconnection.py Loading ...
httppeer.py Loading ...
i18n.py Loading ...
ignore.py Loading ...
keepalive.py Loading ...
localrepo.py Loading ...
lock.py Loading ...
lsprof.py Loading ...
lsprofcalltree.py Loading ...
mail.py Loading ...
manifest.py Loading ...
match.py Loading ...
mdiff.py Loading ...
merge.py Loading ...
minirst.py Loading ...
mpatch.c Loading ...
node.py Loading ...
obsolete.py Loading ...
osutil.c Loading ...
parser.py Loading ...
parsers.c Loading ...
patch.py Loading ...
pathencode.c Loading ...
peer.py Loading ...
phases.py Loading ...
posix.py Loading ...
pushkey.py Loading ...
pvec.py Loading ...
py3kcompat.py Loading ...
repair.py Loading ...
repoview.py Loading ...
revlog.py Loading ...
revset.py Loading ...
scmposix.py Loading ...
scmutil.py Loading ...
scmwindows.py Loading ...
setdiscovery.py Loading ...
similar.py Loading ...
simplemerge.py Loading ...
sshpeer.py Loading ...
sshserver.py Loading ...
sslutil.py Loading ...
statichttprepo.py Loading ...
store.py Loading ...
strutil.py Loading ...
subrepo.py Loading ...
tags.py Loading ...
templatefilters.py Loading ...
templatekw.py Loading ...
templater.py Loading ...
transaction.py Loading ...
treediscovery.py Loading ...
ui.py Loading ...
unionrepo.py Loading ...
url.py Loading ...
util.h Loading ...
util.py Loading ...
verify.py Loading ...
win32.py Loading ...
windows.py Loading ...
wireproto.py Loading ...
worker.py Loading ...