Mercurial > hg
annotate tests/test-convert-svn-startrev.t @ 30288:ceddc3d94d74
revlog: inline start() and end() for perf reasons
When I implemented `hg perfrevlogchunks`, one of the things that
stood out was N * _chunk() calls was ~38x slower than 1
_chunks() call. Specifically, on the mozilla-unified repo:
N*_chunk: 0.528997s
1*_chunks: 0.013735s
This repo has 352,097 changesets. So the average time per changeset
comes out to:
N*_chunk: 1.502us
1*_chunks: 0.039us
If you extrapolate these numbers to a repository with 1M changesets,
that comes out to 1.502s versus 0.039s, which is significant.
At these latencies, Python attribute lookups and function calls
matter. So, this patch inlines some code to cut down on that overhead.
The impact of this patch on N*_chunk() calls is clear:
! wall 0.528997 comb 0.520000 user 0.500000 sys 0.020000 (best of 19)
! wall 0.367723 comb 0.370000 user 0.350000 sys 0.020000 (best of 27)
So, we go from ~38x slower to ~27x. A nice improvement. But there's
still a long way to go.
It's worth noting that functionality like revsets perform changelog
lookups one revision at a time. So this code path is worth optimizing.
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Sat, 22 Oct 2016 15:41:23 -0700 |
parents | 7a9cbb315d84 |
children |
rev | line source |
---|---|
22046
7a9cbb315d84
tests: replace exit 80 with #require
Matt Mackall <mpm@selenic.com>
parents:
20117
diff
changeset
|
1 #require svn svn-bindings |
6173
963000ed8cac
convert: add shallow, single branch svn conversions via svn.startrev
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
2 |
13519
43b3b761d9d1
tests: don't overwrite HGRCPATH
Martin Geisler <mg@aragost.com>
parents:
12370
diff
changeset
|
3 $ cat >> $HGRCPATH <<EOF |
12370
f98010f57a5e
tests: unify test-convert-svn-*
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
10200
diff
changeset
|
4 > [extensions] |
17347
2da47de36b6f
check-code: fix check for trailing whitespace on continued lines too
Mads Kiilerich <mads@kiilerich.com>
parents:
13519
diff
changeset
|
5 > convert = |
12370
f98010f57a5e
tests: unify test-convert-svn-*
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
10200
diff
changeset
|
6 > EOF |
f98010f57a5e
tests: unify test-convert-svn-*
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
10200
diff
changeset
|
7 $ convert() |
f98010f57a5e
tests: unify test-convert-svn-*
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
10200
diff
changeset
|
8 > { |
f98010f57a5e
tests: unify test-convert-svn-*
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
10200
diff
changeset
|
9 > startrev=$1 |
f98010f57a5e
tests: unify test-convert-svn-*
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
10200
diff
changeset
|
10 > repopath=A-r$startrev-hg |
f98010f57a5e
tests: unify test-convert-svn-*
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
10200
diff
changeset
|
11 > hg convert --config convert.svn.startrev=$startrev \ |
f98010f57a5e
tests: unify test-convert-svn-*
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
10200
diff
changeset
|
12 > --config convert.svn.trunk=branches/branch1 \ |
f98010f57a5e
tests: unify test-convert-svn-*
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
10200
diff
changeset
|
13 > --config convert.svn.branches=" " \ |
f98010f57a5e
tests: unify test-convert-svn-*
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
10200
diff
changeset
|
14 > --config convert.svn.tags= \ |
f98010f57a5e
tests: unify test-convert-svn-*
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
10200
diff
changeset
|
15 > --datesort svn-repo $repopath |
20117
aa9385f983fa
tests: don't load unnecessary graphlog extension
Martin Geisler <martin@geisler.net>
parents:
17347
diff
changeset
|
16 > hg -R $repopath log -G \ |
12370
f98010f57a5e
tests: unify test-convert-svn-*
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
10200
diff
changeset
|
17 > --template '{rev} {desc|firstline} files: {files}\n' |
f98010f57a5e
tests: unify test-convert-svn-*
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
10200
diff
changeset
|
18 > echo |
f98010f57a5e
tests: unify test-convert-svn-*
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
10200
diff
changeset
|
19 > } |
6173
963000ed8cac
convert: add shallow, single branch svn conversions via svn.startrev
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
20 |
12370
f98010f57a5e
tests: unify test-convert-svn-*
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
10200
diff
changeset
|
21 $ svnadmin create svn-repo |
f98010f57a5e
tests: unify test-convert-svn-*
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
10200
diff
changeset
|
22 $ svnadmin load -q svn-repo < "$TESTDIR/svn/startrev.svndump" |
f98010f57a5e
tests: unify test-convert-svn-*
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
10200
diff
changeset
|
23 |
f98010f57a5e
tests: unify test-convert-svn-*
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
10200
diff
changeset
|
24 Convert before branching point |
6173
963000ed8cac
convert: add shallow, single branch svn conversions via svn.startrev
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
25 |
12370
f98010f57a5e
tests: unify test-convert-svn-*
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
10200
diff
changeset
|
26 $ convert 3 |
f98010f57a5e
tests: unify test-convert-svn-*
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
10200
diff
changeset
|
27 initializing destination A-r3-hg repository |
f98010f57a5e
tests: unify test-convert-svn-*
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
10200
diff
changeset
|
28 scanning source... |
f98010f57a5e
tests: unify test-convert-svn-*
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
10200
diff
changeset
|
29 sorting... |
f98010f57a5e
tests: unify test-convert-svn-*
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
10200
diff
changeset
|
30 converting... |
f98010f57a5e
tests: unify test-convert-svn-*
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
10200
diff
changeset
|
31 3 removeb |
f98010f57a5e
tests: unify test-convert-svn-*
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
10200
diff
changeset
|
32 2 changeaa |
f98010f57a5e
tests: unify test-convert-svn-*
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
10200
diff
changeset
|
33 1 branch, changeaaa |
f98010f57a5e
tests: unify test-convert-svn-*
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
10200
diff
changeset
|
34 0 addc,changeaaaa |
f98010f57a5e
tests: unify test-convert-svn-*
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
10200
diff
changeset
|
35 o 3 addc,changeaaaa files: a c |
f98010f57a5e
tests: unify test-convert-svn-*
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
10200
diff
changeset
|
36 | |
f98010f57a5e
tests: unify test-convert-svn-*
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
10200
diff
changeset
|
37 o 2 branch, changeaaa files: a |
f98010f57a5e
tests: unify test-convert-svn-*
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
10200
diff
changeset
|
38 | |
f98010f57a5e
tests: unify test-convert-svn-*
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
10200
diff
changeset
|
39 o 1 changeaa files: a |
f98010f57a5e
tests: unify test-convert-svn-*
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
10200
diff
changeset
|
40 | |
f98010f57a5e
tests: unify test-convert-svn-*
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
10200
diff
changeset
|
41 o 0 removeb files: a |
f98010f57a5e
tests: unify test-convert-svn-*
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
10200
diff
changeset
|
42 |
f98010f57a5e
tests: unify test-convert-svn-*
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
10200
diff
changeset
|
43 |
f98010f57a5e
tests: unify test-convert-svn-*
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
10200
diff
changeset
|
44 |
f98010f57a5e
tests: unify test-convert-svn-*
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
10200
diff
changeset
|
45 Convert before branching point |
6173
963000ed8cac
convert: add shallow, single branch svn conversions via svn.startrev
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
46 |
12370
f98010f57a5e
tests: unify test-convert-svn-*
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
10200
diff
changeset
|
47 $ convert 4 |
f98010f57a5e
tests: unify test-convert-svn-*
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
10200
diff
changeset
|
48 initializing destination A-r4-hg repository |
f98010f57a5e
tests: unify test-convert-svn-*
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
10200
diff
changeset
|
49 scanning source... |
f98010f57a5e
tests: unify test-convert-svn-*
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
10200
diff
changeset
|
50 sorting... |
f98010f57a5e
tests: unify test-convert-svn-*
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
10200
diff
changeset
|
51 converting... |
f98010f57a5e
tests: unify test-convert-svn-*
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
10200
diff
changeset
|
52 2 changeaa |
f98010f57a5e
tests: unify test-convert-svn-*
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
10200
diff
changeset
|
53 1 branch, changeaaa |
f98010f57a5e
tests: unify test-convert-svn-*
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
10200
diff
changeset
|
54 0 addc,changeaaaa |
f98010f57a5e
tests: unify test-convert-svn-*
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
10200
diff
changeset
|
55 o 2 addc,changeaaaa files: a c |
f98010f57a5e
tests: unify test-convert-svn-*
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
10200
diff
changeset
|
56 | |
f98010f57a5e
tests: unify test-convert-svn-*
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
10200
diff
changeset
|
57 o 1 branch, changeaaa files: a |
f98010f57a5e
tests: unify test-convert-svn-*
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
10200
diff
changeset
|
58 | |
f98010f57a5e
tests: unify test-convert-svn-*
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
10200
diff
changeset
|
59 o 0 changeaa files: a |
f98010f57a5e
tests: unify test-convert-svn-*
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
10200
diff
changeset
|
60 |
f98010f57a5e
tests: unify test-convert-svn-*
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
10200
diff
changeset
|
61 |
f98010f57a5e
tests: unify test-convert-svn-*
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
10200
diff
changeset
|
62 |
f98010f57a5e
tests: unify test-convert-svn-*
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
10200
diff
changeset
|
63 Convert at branching point |
f98010f57a5e
tests: unify test-convert-svn-*
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
10200
diff
changeset
|
64 |
f98010f57a5e
tests: unify test-convert-svn-*
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
10200
diff
changeset
|
65 $ convert 5 |
f98010f57a5e
tests: unify test-convert-svn-*
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
10200
diff
changeset
|
66 initializing destination A-r5-hg repository |
f98010f57a5e
tests: unify test-convert-svn-*
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
10200
diff
changeset
|
67 scanning source... |
f98010f57a5e
tests: unify test-convert-svn-*
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
10200
diff
changeset
|
68 sorting... |
f98010f57a5e
tests: unify test-convert-svn-*
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
10200
diff
changeset
|
69 converting... |
f98010f57a5e
tests: unify test-convert-svn-*
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
10200
diff
changeset
|
70 1 branch, changeaaa |
f98010f57a5e
tests: unify test-convert-svn-*
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
10200
diff
changeset
|
71 0 addc,changeaaaa |
f98010f57a5e
tests: unify test-convert-svn-*
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
10200
diff
changeset
|
72 o 1 addc,changeaaaa files: a c |
f98010f57a5e
tests: unify test-convert-svn-*
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
10200
diff
changeset
|
73 | |
f98010f57a5e
tests: unify test-convert-svn-*
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
10200
diff
changeset
|
74 o 0 branch, changeaaa files: a |
f98010f57a5e
tests: unify test-convert-svn-*
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
10200
diff
changeset
|
75 |
f98010f57a5e
tests: unify test-convert-svn-*
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
10200
diff
changeset
|
76 |
f98010f57a5e
tests: unify test-convert-svn-*
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
10200
diff
changeset
|
77 |
f98010f57a5e
tests: unify test-convert-svn-*
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
10200
diff
changeset
|
78 Convert last revision only |
f98010f57a5e
tests: unify test-convert-svn-*
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
10200
diff
changeset
|
79 |
f98010f57a5e
tests: unify test-convert-svn-*
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
10200
diff
changeset
|
80 $ convert 6 |
f98010f57a5e
tests: unify test-convert-svn-*
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
10200
diff
changeset
|
81 initializing destination A-r6-hg repository |
f98010f57a5e
tests: unify test-convert-svn-*
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
10200
diff
changeset
|
82 scanning source... |
f98010f57a5e
tests: unify test-convert-svn-*
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
10200
diff
changeset
|
83 sorting... |
f98010f57a5e
tests: unify test-convert-svn-*
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
10200
diff
changeset
|
84 converting... |
f98010f57a5e
tests: unify test-convert-svn-*
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
10200
diff
changeset
|
85 0 addc,changeaaaa |
f98010f57a5e
tests: unify test-convert-svn-*
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
10200
diff
changeset
|
86 o 0 addc,changeaaaa files: a c |
f98010f57a5e
tests: unify test-convert-svn-*
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
10200
diff
changeset
|
87 |
f98010f57a5e
tests: unify test-convert-svn-*
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
10200
diff
changeset
|
88 |