Mercurial > hg
view tests/test-generaldelta.t @ 20713:6a1a4c212d50
revset: improve head revset performance
Previously the head() revset would iterate over every item in the subset and
check if it was a head. Since the subset is often the entire repo, this was
slow on large repos. Now we iterate over each item in the head list and check if
it's in the subset, which results in much less work.
hg log -r 'head()' on a large repo:
Before: 0.95s
After: 0.28s
author | Durham Goode <durham@fb.com> |
---|---|
date | Thu, 13 Mar 2014 13:47:21 -0700 |
parents | 2c886dedd902 |
children | cc0ff93d0c0c |
line wrap: on
line source
Check whether size of generaldelta revlog is not bigger than its regular equivalent. Test would fail if generaldelta was naive implementation of parentdelta: third manifest revision would be fully inserted due to big distance from its paren revision (zero). $ hg init repo $ cd repo $ echo foo > foo $ echo bar > bar $ hg commit -q -Am boo $ hg clone --pull . ../gdrepo -q --config format.generaldelta=yes $ for r in 1 2 3; do > echo $r > foo > hg commit -q -m $r > hg up -q -r 0 > hg pull . -q -r $r -R ../gdrepo > done $ cd .. >>> import os >>> regsize = os.stat("repo/.hg/store/00manifest.i").st_size >>> gdsize = os.stat("gdrepo/.hg/store/00manifest.i").st_size >>> if regsize < gdsize: ... print 'generaldata increased size of manifest'