annotate tests/test-sparse-clear.t @ 41979:0d467e4de4ae

discovery: fix embarrassing typo in slice definition The code introduced in e514799e4e07 ended up having a silly bug. The indexing selected a single item slice picking only p1. The discovery result was still correct, but the sampling was hampered, sometime leading to much more round trips being performed. Fixing this issue restore the previous sampling behavior. This fix has a negative performance impact on the pathological case the previous test has been built. # parent of this changesets ! wall 5.313884 comb 5.310000 user 5.260000 sys 0.050000 (best of 5) ! wall 6.711860 comb 6.710000 user 6.670000 sys 0.040000 (max of 5) ! wall 5.844016 comb 5.842000 user 5.784000 sys 0.058000 (avg of 5) ! wall 5.778635 comb 5.780000 user 5.740000 sys 0.040000 (median of 5) # With this changesets. ! wall 6.350879 comb 6.350000 user 6.300000 sys 0.050000 (best of 5) ! wall 6.653647 comb 6.660000 user 6.480000 sys 0.180000 (max of 5) ! wall 6.492762 comb 6.494000 user 6.414000 sys 0.080000 (avg of 5) ! wall 6.547577 comb 6.550000 user 6.490000 sys 0.060000 (median of 5) Changeset e514799e4e07 raised the question of using the "_uncheckedparentrevs" instead of the current code. So I ran comparative timing: # old code: 55919b96c02a (e514799e4e07 parent) ! wall 64.078708 comb 64.080000 user 63.160000 sys 0.920000 (best of 5) ! wall 68.296300 comb 68.290000 user 67.410000 sys 0.880000 (max of 5) ! wall 65.899075 comb 65.894000 user 65.082000 sys 0.812000 (avg of 5) ! wall 66.140286 comb 66.130000 user 65.330000 sys 0.800000 (median of 5) # buggy code: e514799e4e07 ! wall 46.605362 comb 46.610000 user 45.880000 sys 0.730000 (best of 5) ! wall 48.619659 comb 48.620000 user 47.890000 sys 0.730000 (max of 5) ! wall 47.350247 comb 47.350000 user 46.672000 sys 0.678000 (avg of 5) ! wall 46.983224 comb 46.980000 user 46.350000 sys 0.630000 (median of 5) # fixed code: e514799e4e07 with this fix ! wall 55.858460 comb 55.850000 user 55.090000 sys 0.760000 (best of 5) ! wall 59.048805 comb 59.060000 user 58.110000 sys 0.950000 (max of 5) ! wall 57.192639 comb 57.192000 user 56.350000 sys 0.842000 (avg of 5) ! wall 57.056373 comb 57.060000 user 56.160000 sys 0.900000 (median of 5) # version using uncheckedparents ! wall 56.471916 comb 56.470000 user 55.630000 sys 0.840000 (best of 5) ! wall 58.228793 comb 58.230000 user 57.600000 sys 0.630000 (max of 5) ! wall 57.377583 comb 57.378000 user 56.674000 sys 0.704000 (avg of 5) ! wall 57.008843 comb 57.010000 user 56.330000 sys 0.680000 (median of 5) So it looks like the overhead from `_uncheckedparentrevs` is not that impactful. I'll investigate this shortly. I'm almost done updating our benchmark suite with more meaningful discovery cases.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Thu, 14 Mar 2019 19:13:45 +0000
parents c9cbf4de27ba
children 5c2a4f37eace
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
33289
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
1 test sparse
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
2
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
3 $ hg init myrepo
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
4 $ cd myrepo
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
5 $ cat >> $HGRCPATH <<EOF
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
6 > [extensions]
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
7 > sparse=
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
8 > purge=
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
9 > strip=
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
10 > rebase=
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
11 > EOF
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
12
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
13 $ echo a > index.html
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
14 $ echo x > data.py
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
15 $ echo z > readme.txt
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
16 $ cat > base.sparse <<EOF
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
17 > [include]
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
18 > *.sparse
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
19 > EOF
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
20 $ hg ci -Aqm 'initial'
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
21 $ cat > webpage.sparse <<EOF
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
22 > %include base.sparse
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
23 > [include]
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
24 > *.html
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
25 > EOF
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
26 $ hg ci -Aqm 'initial'
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
27
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
28 Clear rules when there are includes
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
29
33293
c9cbf4de27ba sparse: rename command to debugsparse
Gregory Szorc <gregory.szorc@gmail.com>
parents: 33289
diff changeset
30 $ hg debugsparse --include *.py
33289
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
31 $ ls
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
32 data.py
33293
c9cbf4de27ba sparse: rename command to debugsparse
Gregory Szorc <gregory.szorc@gmail.com>
parents: 33289
diff changeset
33 $ hg debugsparse --clear-rules
33289
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
34 $ ls
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
35 base.sparse
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
36 data.py
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
37 index.html
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
38 readme.txt
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
39 webpage.sparse
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
40
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
41 Clear rules when there are excludes
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
42
33293
c9cbf4de27ba sparse: rename command to debugsparse
Gregory Szorc <gregory.szorc@gmail.com>
parents: 33289
diff changeset
43 $ hg debugsparse --exclude *.sparse
33289
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
44 $ ls
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
45 data.py
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
46 index.html
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
47 readme.txt
33293
c9cbf4de27ba sparse: rename command to debugsparse
Gregory Szorc <gregory.szorc@gmail.com>
parents: 33289
diff changeset
48 $ hg debugsparse --clear-rules
33289
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
49 $ ls
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
50 base.sparse
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
51 data.py
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
52 index.html
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
53 readme.txt
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
54 webpage.sparse
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
55
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
56 Clearing rules should not alter profiles
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
57
33293
c9cbf4de27ba sparse: rename command to debugsparse
Gregory Szorc <gregory.szorc@gmail.com>
parents: 33289
diff changeset
58 $ hg debugsparse --enable-profile webpage.sparse
33289
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
59 $ ls
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
60 base.sparse
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
61 index.html
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
62 webpage.sparse
33293
c9cbf4de27ba sparse: rename command to debugsparse
Gregory Szorc <gregory.szorc@gmail.com>
parents: 33289
diff changeset
63 $ hg debugsparse --include *.py
33289
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
64 $ ls
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
65 base.sparse
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
66 data.py
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
67 index.html
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
68 webpage.sparse
33293
c9cbf4de27ba sparse: rename command to debugsparse
Gregory Szorc <gregory.szorc@gmail.com>
parents: 33289
diff changeset
69 $ hg debugsparse --clear-rules
33289
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
70 $ ls
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
71 base.sparse
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
72 index.html
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
73 webpage.sparse