##// END OF EJS Templates
perf: add command for measuring revlog chunk operations...
perf: add command for measuring revlog chunk operations Upcoming commits will teach revlogs to leverage the new compression engine API so that new compression formats can more easily be leveraged in revlogs. We want to be sure this refactoring doesn't regress performance. So this commit introduces "perfrevchunks" to explicitly test performance of reading, decompressing, and recompressing revlog chunks. Here is output when run on the mozilla-unified repo: $ hg perfrevlogchunks -c ! read ! wall 0.346603 comb 0.350000 user 0.340000 sys 0.010000 (best of 28) ! read w/ reused fd ! wall 0.337707 comb 0.340000 user 0.320000 sys 0.020000 (best of 30) ! read batch ! wall 0.013206 comb 0.020000 user 0.000000 sys 0.020000 (best of 221) ! read batch w/ reused fd ! wall 0.013259 comb 0.030000 user 0.010000 sys 0.020000 (best of 222) ! chunk ! wall 1.909939 comb 1.910000 user 1.900000 sys 0.010000 (best of 6) ! chunk batch ! wall 1.750677 comb 1.760000 user 1.740000 sys 0.020000 (best of 6) ! compress ! wall 5.668004 comb 5.670000 user 5.670000 sys 0.000000 (best of 3) $ hg perfrevlogchunks -m ! read ! wall 0.365834 comb 0.370000 user 0.350000 sys 0.020000 (best of 26) ! read w/ reused fd ! wall 0.350160 comb 0.350000 user 0.320000 sys 0.030000 (best of 28) ! read batch ! wall 0.024777 comb 0.020000 user 0.000000 sys 0.020000 (best of 119) ! read batch w/ reused fd ! wall 0.024895 comb 0.030000 user 0.000000 sys 0.030000 (best of 118) ! chunk ! wall 2.514061 comb 2.520000 user 2.480000 sys 0.040000 (best of 4) ! chunk batch ! wall 2.380788 comb 2.380000 user 2.360000 sys 0.020000 (best of 5) ! compress ! wall 9.815297 comb 9.820000 user 9.820000 sys 0.000000 (best of 3) We already see some interesting data, such as how much slower non-batched chunk reading is and that zlib compression appears to be >2x slower than decompression. I didn't have the data when I wrote this commit message, but I ran this on Mozilla's NFS-based Mercurial server and the time for reading with a reused file descriptor was faster. So I think it is worth testing both with and without file descriptor reuse so we can make informed decisions about recycling file descriptors.

File last commit:

r26594:75e29fcc default
r30451:94ca0e13 default
Show More
test-convert-cvs.t
500 lines | 9.6 KiB | text/troff | Tads3Lexer
/ tests / test-convert-cvs.t
Matt Mackall
tests: replace exit 80 with #require
r22046 #require cvs
Matt Mackall
tests: unify test-convert-cvs
r12519
$ cvscall()
> {
> cvs -f "$@"
> }
$ hgcat()
> {
> hg --cwd src-hg cat -r tip "$1"
> }
$ echo "[extensions]" >> $HGRCPATH
$ echo "convert = " >> $HGRCPATH
$ cat > cvshooks.py <<EOF
> def cvslog(ui,repo,hooktype,log):
> print "%s hook: %d entries"%(hooktype,len(log))
>
> def cvschangesets(ui,repo,hooktype,changesets):
> print "%s hook: %d changesets"%(hooktype,len(changesets))
> EOF
$ hookpath=`pwd`
Yuya Nishihara
tests: write hgrc of more than two lines by using shell heredoc...
r23172 $ cat <<EOF >> $HGRCPATH
> [hooks]
> cvslog = python:$hookpath/cvshooks.py:cvslog
> cvschangesets = python:$hookpath/cvshooks.py:cvschangesets
> EOF
Matt Mackall
tests: unify test-convert-cvs
r12519
create cvs repository
$ mkdir cvsrepo
$ cd cvsrepo
$ CVSROOT=`pwd`
$ export CVSROOT
$ CVS_OPTIONS=-f
$ export CVS_OPTIONS
$ cd ..
Thomas Klausner
tests: run 'cvs init' only on non-existent directories (issue4482)...
r23675 $ rmdir cvsrepo
Matt Mackall
tests: unify test-convert-cvs
r12519 $ cvscall -q -d "$CVSROOT" init
create source directory
$ mkdir src-temp
$ cd src-temp
$ echo a > a
$ mkdir b
$ cd b
$ echo c > c
$ cd ..
import source directory
$ cvscall -q import -m import src INITIAL start
N src/a
N src/b/c
No conflicts created by this import
$ cd ..
checkout source directory
$ cvscall -q checkout src
U src/a
U src/b/c
commit a new revision changing b/c
$ cd src
$ sleep 1
$ echo c >> b/c
$ cvscall -q commit -mci0 . | grep '<--'
Mads Kiilerich
tests: remove redundant globs...
r12640 $TESTTMP/cvsrepo/src/b/c,v <-- *c (glob)
Matt Mackall
tests: unify test-convert-cvs
r12519 $ cd ..
Julian Cowley
convert: add config option to use the local time zone...
r17974 convert fresh repo and also check localtimezone option
NOTE: This doesn't check all time zones -- it merely determines that
the configuration option is taking effect.
Matt Mackall
tests: unify test-convert-cvs
r12519
Julian Cowley
convert: add config option to use the local time zone...
r17974 An arbitrary (U.S.) time zone is used here. TZ=US/Hawaii is selected
since it does not use DST (unlike other U.S. time zones) and is always
a fixed difference from UTC.
$ TZ=US/Hawaii hg convert --config convert.localtimezone=True src src-hg
Matt Mackall
tests: unify test-convert-cvs
r12519 initializing destination src-hg repository
Mads Kiilerich
tests: remove redundant globs...
r12640 connecting to $TESTTMP/cvsrepo
Matt Mackall
tests: unify test-convert-cvs
r12519 scanning source...
collecting CVS rlog
5 log entries
cvslog hook: 5 entries
creating changesets
3 changeset entries
cvschangesets hook: 3 changesets
sorting...
converting...
2 Initial revision
Mads Kiilerich
convert: make toposort order stable when multiple orderings are possible...
r18376 1 ci0
0 import
Matt Mackall
tests: unify test-convert-cvs
r12519 updating tags
$ hgcat a
a
$ hgcat b/c
c
c
convert fresh repo with --filemap
$ echo include b/c > filemap
$ hg convert --filemap filemap src src-filemap
initializing destination src-filemap repository
Mads Kiilerich
tests: remove redundant globs...
r12640 connecting to $TESTTMP/cvsrepo
Matt Mackall
tests: unify test-convert-cvs
r12519 scanning source...
collecting CVS rlog
5 log entries
cvslog hook: 5 entries
creating changesets
3 changeset entries
cvschangesets hook: 3 changesets
sorting...
converting...
2 Initial revision
Mads Kiilerich
convert: make toposort order stable when multiple orderings are possible...
r18376 1 ci0
0 import
Matt Mackall
tests: unify test-convert-cvs
r12519 filtering out empty revision
Matt Harbison
convert: apply the appropriate phases to the destination (issue4165)...
r25571 repository tip rolled back to revision 1 (undo convert)
Matt Mackall
tests: unify test-convert-cvs
r12519 updating tags
$ hgcat b/c
c
c
$ hg -R src-filemap log --template '{rev} {desc} files: {files}\n'
2 update tags files: .hgtags
1 ci0 files: b/c
0 Initial revision files: b/c
convert full repository (issue1649)
$ cvscall -q -d "$CVSROOT" checkout -d srcfull "." | grep -v CVSROOT
U srcfull/src/a
U srcfull/src/b/c
$ ls srcfull
CVS
CVSROOT
src
$ hg convert srcfull srcfull-hg \
> | grep -v 'log entries' | grep -v 'hook:' \
> | grep -v '^[0-3] .*' # filter instable changeset order
initializing destination srcfull-hg repository
Mads Kiilerich
tests: remove redundant globs...
r12640 connecting to $TESTTMP/cvsrepo
Matt Mackall
tests: unify test-convert-cvs
r12519 scanning source...
collecting CVS rlog
creating changesets
4 changeset entries
sorting...
converting...
updating tags
Mads Kiilerich
tests: add missing no-outer-repo requirements...
r17015 $ hg cat -r tip --cwd srcfull-hg src/a
Matt Mackall
tests: unify test-convert-cvs
r12519 a
Mads Kiilerich
tests: add missing no-outer-repo requirements...
r17015 $ hg cat -r tip --cwd srcfull-hg src/b/c
Matt Mackall
tests: unify test-convert-cvs
r12519 c
c
commit new file revisions
$ cd src
$ echo a >> a
$ echo c >> b/c
$ cvscall -q commit -mci1 . | grep '<--'
Mads Kiilerich
tests: remove redundant globs...
r12640 $TESTTMP/cvsrepo/src/a,v <-- a
$TESTTMP/cvsrepo/src/b/c,v <-- *c (glob)
Matt Mackall
tests: unify test-convert-cvs
r12519 $ cd ..
convert again
Julian Cowley
convert: add config option to use the local time zone...
r17974 $ TZ=US/Hawaii hg convert --config convert.localtimezone=True src src-hg
Mads Kiilerich
tests: remove redundant globs...
r12640 connecting to $TESTTMP/cvsrepo
Matt Mackall
tests: unify test-convert-cvs
r12519 scanning source...
collecting CVS rlog
7 log entries
cvslog hook: 7 entries
creating changesets
4 changeset entries
cvschangesets hook: 4 changesets
sorting...
converting...
0 ci1
$ hgcat a
a
a
$ hgcat b/c
c
c
c
convert again with --filemap
$ hg convert --filemap filemap src src-filemap
Mads Kiilerich
tests: remove redundant globs...
r12640 connecting to $TESTTMP/cvsrepo
Matt Mackall
tests: unify test-convert-cvs
r12519 scanning source...
collecting CVS rlog
7 log entries
cvslog hook: 7 entries
creating changesets
4 changeset entries
cvschangesets hook: 4 changesets
sorting...
converting...
0 ci1
$ hgcat b/c
c
c
c
$ hg -R src-filemap log --template '{rev} {desc} files: {files}\n'
3 ci1 files: b/c
2 update tags files: .hgtags
1 ci0 files: b/c
0 Initial revision files: b/c
commit branch
$ cd src
$ cvs -q update -r1.1 b/c
U b/c
$ cvs -q tag -b branch
T a
T b/c
$ cvs -q update -r branch > /dev/null
Emanuele Giaquinta
test-convert-cvs: add sleep so cvs notices changes...
r26594 $ sleep 1
Matt Mackall
tests: unify test-convert-cvs
r12519 $ echo d >> b/c
$ cvs -q commit -mci2 . | grep '<--'
Mads Kiilerich
tests: remove redundant globs...
r12640 $TESTTMP/cvsrepo/src/b/c,v <-- *c (glob)
Matt Mackall
tests: unify test-convert-cvs
r12519 $ cd ..
convert again
Julian Cowley
convert: add config option to use the local time zone...
r17974 $ TZ=US/Hawaii hg convert --config convert.localtimezone=True src src-hg
Mads Kiilerich
tests: remove redundant globs...
r12640 connecting to $TESTTMP/cvsrepo
Matt Mackall
tests: unify test-convert-cvs
r12519 scanning source...
collecting CVS rlog
8 log entries
cvslog hook: 8 entries
creating changesets
5 changeset entries
cvschangesets hook: 5 changesets
sorting...
converting...
0 ci2
$ hgcat b/c
c
d
convert again with --filemap
Julian Cowley
convert: add config option to use the local time zone...
r17974 $ TZ=US/Hawaii hg convert --config convert.localtimezone=True --filemap filemap src src-filemap
Mads Kiilerich
tests: remove redundant globs...
r12640 connecting to $TESTTMP/cvsrepo
Matt Mackall
tests: unify test-convert-cvs
r12519 scanning source...
collecting CVS rlog
8 log entries
cvslog hook: 8 entries
creating changesets
5 changeset entries
cvschangesets hook: 5 changesets
sorting...
converting...
0 ci2
$ hgcat b/c
c
d
$ hg -R src-filemap log --template '{rev} {desc} files: {files}\n'
4 ci2 files: b/c
3 ci1 files: b/c
2 update tags files: .hgtags
1 ci0 files: b/c
0 Initial revision files: b/c
commit a new revision with funny log message
$ cd src
$ sleep 1
$ echo e >> a
$ cvscall -q commit -m'funny
> ----------------------------
> log message' . | grep '<--' |\
> sed -e 's:.*src/\(.*\),v.*:checking in src/\1,v:g'
checking in src/a,v
commit new file revisions with some fuzz
$ sleep 1
$ echo f >> a
$ cvscall -q commit -mfuzzy . | grep '<--'
Mads Kiilerich
tests: remove redundant globs...
r12640 $TESTTMP/cvsrepo/src/a,v <-- a
Matt Mackall
tests: unify test-convert-cvs
r12519 $ sleep 4 # the two changes will be split if fuzz < 4
$ echo g >> b/c
$ cvscall -q commit -mfuzzy . | grep '<--'
Mads Kiilerich
tests: remove redundant globs...
r12640 $TESTTMP/cvsrepo/src/b/c,v <-- *c (glob)
Matt Mackall
tests: unify test-convert-cvs
r12519 $ cd ..
convert again
Julian Cowley
convert: add config option to use the local time zone...
r17974 $ TZ=US/Hawaii hg convert --config convert.cvsps.fuzz=2 --config convert.localtimezone=True src src-hg
Mads Kiilerich
tests: remove redundant globs...
r12640 connecting to $TESTTMP/cvsrepo
Matt Mackall
tests: unify test-convert-cvs
r12519 scanning source...
collecting CVS rlog
11 log entries
cvslog hook: 11 entries
creating changesets
8 changeset entries
cvschangesets hook: 8 changesets
sorting...
converting...
2 funny
1 fuzzy
0 fuzzy
Martin Geisler
tests: don't load unnecessary graphlog extension...
r20117 $ hg -R src-hg log -G --template '{rev} ({branches}) {desc} date: {date|date} files: {files}\n'
Julian Cowley
convert: add config option to use the local time zone...
r17974 o 8 (branch) fuzzy date: * -1000 files: b/c (glob)
Matt Mackall
tests: unify test-convert-cvs
r12519 |
Julian Cowley
convert: add config option to use the local time zone...
r17974 o 7 (branch) fuzzy date: * -1000 files: a (glob)
Matt Mackall
tests: unify test-convert-cvs
r12519 |
o 6 (branch) funny
| ----------------------------
Julian Cowley
convert: add config option to use the local time zone...
r17974 | log message date: * -1000 files: a (glob)
o 5 (branch) ci2 date: * -1000 files: b/c (glob)
Matt Mackall
tests: unify test-convert-cvs
r12519
Julian Cowley
convert: add config option to use the local time zone...
r17974 o 4 () ci1 date: * -1000 files: a b/c (glob)
Matt Mackall
tests: unify test-convert-cvs
r12519 |
Julian Cowley
convert: add config option to use the local time zone...
r17974 o 3 () update tags date: * +0000 files: .hgtags (glob)
Matt Mackall
tests: unify test-convert-cvs
r12519 |
Mads Kiilerich
convert: make toposort order stable when multiple orderings are possible...
r18376 | o 2 (INITIAL) import date: * -1000 files: (glob)
| |
o | 1 () ci0 date: * -1000 files: b/c (glob)
Matt Mackall
tests: unify test-convert-cvs
r12519 |/
Julian Cowley
convert: add config option to use the local time zone...
r17974 o 0 () Initial revision date: * -1000 files: a b/c (glob)
Matt Mackall
tests: unify test-convert-cvs
r12519
testing debugcvsps
$ cd src
Emanuele Giaquinta
cvsps: fix computation of parent revisions when log caching is on...
r26593 $ hg debugcvsps --fuzz=2 -x >/dev/null
commit a new revision changing a and removing b/c
$ cvscall -q update -A
U a
U b/c
$ sleep 1
$ echo h >> a
$ cvscall -Q remove -f b/c
$ cvscall -q commit -mci | grep '<--'
$TESTTMP/cvsrepo/src/a,v <-- a
$TESTTMP/cvsrepo/src/b/c,v <-- *c (glob)
update and verify the cvsps cache
$ hg debugcvsps --fuzz=2 -u
Matt Mackall
tests: unify test-convert-cvs
r12519 collecting CVS rlog
Emanuele Giaquinta
cvsps: fix computation of parent revisions when log caching is on...
r26593 13 log entries
cvslog hook: 13 entries
Matt Mackall
tests: unify test-convert-cvs
r12519 creating changesets
Emanuele Giaquinta
cvsps: fix computation of parent revisions when log caching is on...
r26593 11 changeset entries
cvschangesets hook: 11 changesets
Matt Mackall
tests: unify test-convert-cvs
r12519 ---------------------
PatchSet 1
Date: * (glob)
Author: * (glob)
Branch: HEAD
Tag: (none)
Branchpoints: INITIAL
Log:
Initial revision
Members:
a:INITIAL->1.1
---------------------
PatchSet 2
Date: * (glob)
Author: * (glob)
Branch: HEAD
Tag: (none)
Branchpoints: INITIAL, branch
Log:
Initial revision
Members:
b/c:INITIAL->1.1
---------------------
PatchSet 3
Date: * (glob)
Author: * (glob)
Branch: INITIAL
Tag: start
Log:
import
Members:
a:1.1->1.1.1.1
b/c:1.1->1.1.1.1
---------------------
PatchSet 4
Date: * (glob)
Author: * (glob)
Branch: HEAD
Tag: (none)
Log:
ci0
Members:
b/c:1.1->1.2
---------------------
PatchSet 5
Date: * (glob)
Author: * (glob)
Branch: HEAD
Tag: (none)
Augie Fackler
cvsps: use a different tiebreaker to avoid flaky test...
r24305 Branchpoints: branch
Matt Mackall
tests: unify test-convert-cvs
r12519 Log:
ci1
Members:
Augie Fackler
cvsps: use a different tiebreaker to avoid flaky test...
r24305 a:1.1->1.2
Matt Mackall
tests: unify test-convert-cvs
r12519
---------------------
PatchSet 6
Date: * (glob)
Author: * (glob)
Branch: HEAD
Tag: (none)
Log:
ci1
Members:
Augie Fackler
cvsps: use a different tiebreaker to avoid flaky test...
r24305 b/c:1.2->1.3
Matt Mackall
tests: unify test-convert-cvs
r12519
---------------------
PatchSet 7
Date: * (glob)
Author: * (glob)
Branch: branch
Tag: (none)
Log:
ci2
Members:
b/c:1.1->1.1.2.1
---------------------
PatchSet 8
Date: * (glob)
Author: * (glob)
Branch: branch
Tag: (none)
Log:
funny
----------------------------
log message
Members:
a:1.2->1.2.2.1
---------------------
PatchSet 9
Date: * (glob)
Author: * (glob)
Branch: branch
Tag: (none)
Log:
fuzzy
Members:
a:1.2.2.1->1.2.2.2
---------------------
PatchSet 10
Date: * (glob)
Author: * (glob)
Branch: branch
Tag: (none)
Log:
fuzzy
Members:
b/c:1.1.2.1->1.1.2.2
Emanuele Giaquinta
cvsps: fix computation of parent revisions when log caching is on...
r26593 ---------------------
PatchSet 11
Date: * (glob)
Author: * (glob)
Branch: HEAD
Tag: (none)
Log:
ci
Members:
a:1.2->1.3
b/c:1.3->1.4(DEAD)
Matt Mackall
tests: unify test-convert-cvs
r12519
Mads Kiilerich
tests: add missing trailing 'cd ..'...
r16913 $ cd ..