##// END OF EJS Templates
snapshot: also consider the snapshot chain of one unrelated revision...
Boris Feld -
r39541:c6b8eab5 default
parent child Browse files
Show More
@@ -719,6 +719,36 b' def _rawgroups(revlog, p1, p2, cachedelt'
719 parents_snaps[idx].add(s)
719 parents_snaps[idx].add(s)
720 snapfloor = min(parents_snaps[0]) + 1
720 snapfloor = min(parents_snaps[0]) + 1
721 _findsnapshots(revlog, snapshots, snapfloor)
721 _findsnapshots(revlog, snapshots, snapfloor)
722 # search for the highest "unrelated" revision
723 #
724 # Adding snapshots used by "unrelated" revision increase the odd we
725 # reuse an independant, yet better snapshot chain.
726 #
727 # XXX instead of building a set of revisions, we could lazily enumerate
728 # over the chains. That would be more efficient, however we stick to
729 # simple code for now.
730 all_revs = set()
731 for chain in candidate_chains:
732 all_revs.update(chain)
733 other = None
734 for r in revlog.revs(prev, snapfloor):
735 if r not in all_revs:
736 other = r
737 break
738 if other is not None:
739 # To avoid unfair competition, we won't use unrelated intermediate
740 # snapshot that are deeper than the ones from the parent delta
741 # chain.
742 max_depth = max(parents_snaps.keys())
743 chain = deltachain(other)
744 for idx, s in enumerate(chain):
745 if s < snapfloor:
746 continue
747 if max_depth < idx:
748 break
749 if not revlog.issnapshot(s):
750 break
751 parents_snaps[idx].add(s)
722 # Test them as possible intermediate snapshot base
752 # Test them as possible intermediate snapshot base
723 # We test them from highest to lowest level. High level one are more
753 # We test them from highest to lowest level. High level one are more
724 # likely to result in small delta
754 # likely to result in small delta
@@ -756,9 +786,10 b' def _rawgroups(revlog, p1, p2, cachedelt'
756 # more and more snapshot as the repository grow.
786 # more and more snapshot as the repository grow.
757 yield tuple(snapshots[nullrev])
787 yield tuple(snapshots[nullrev])
758
788
759 # other approach failed try against prev to hopefully save us a
789 if not sparse:
760 # fulltext.
790 # other approach failed try against prev to hopefully save us a
761 yield (prev,)
791 # fulltext.
792 yield (prev,)
762
793
763 class deltacomputer(object):
794 class deltacomputer(object):
764 def __init__(self, revlog):
795 def __init__(self, revlog):
@@ -77,7 +77,7 b' repeatedly while some of it changes rare'
77
77
78
78
79 $ f -s .hg/store/data/*.d
79 $ f -s .hg/store/data/*.d
80 .hg/store/data/_s_p_a_r_s_e-_r_e_v_l_o_g-_t_e_s_t-_f_i_l_e.d: size=59302280
80 .hg/store/data/_s_p_a_r_s_e-_r_e_v_l_o_g-_t_e_s_t-_f_i_l_e.d: size=59230936
81 $ hg debugrevlog *
81 $ hg debugrevlog *
82 format : 1
82 format : 1
83 flags : generaldelta
83 flags : generaldelta
@@ -89,45 +89,45 b' repeatedly while some of it changes rare'
89 empty : 0 ( 0.00%)
89 empty : 0 ( 0.00%)
90 text : 0 (100.00%)
90 text : 0 (100.00%)
91 delta : 0 (100.00%)
91 delta : 0 (100.00%)
92 snapshot : 168 ( 3.36%)
92 snapshot : 176 ( 3.52%)
93 lvl-0 : 4 ( 0.08%)
93 lvl-0 : 3 ( 0.06%)
94 lvl-1 : 18 ( 0.36%)
94 lvl-1 : 17 ( 0.34%)
95 lvl-2 : 39 ( 0.78%)
95 lvl-2 : 45 ( 0.90%)
96 lvl-3 : 54 ( 1.08%)
96 lvl-3 : 56 ( 1.12%)
97 lvl-4 : 53 ( 1.06%)
97 lvl-4 : 55 ( 1.10%)
98 deltas : 4833 (96.64%)
98 deltas : 4825 (96.48%)
99 revision size : 59302280
99 revision size : 59230936
100 snapshot : 5833942 ( 9.84%)
100 snapshot : 5770371 ( 9.74%)
101 lvl-0 : 804068 ( 1.36%)
101 lvl-0 : 602962 ( 1.02%)
102 lvl-1 : 1378470 ( 2.32%)
102 lvl-1 : 1534153 ( 2.59%)
103 lvl-2 : 1608138 ( 2.71%)
103 lvl-2 : 1604445 ( 2.71%)
104 lvl-3 : 1222158 ( 2.06%)
104 lvl-3 : 1218174 ( 2.06%)
105 lvl-4 : 821108 ( 1.38%)
105 lvl-4 : 810637 ( 1.37%)
106 deltas : 53468338 (90.16%)
106 deltas : 53460565 (90.26%)
107
107
108 chunks : 5001
108 chunks : 5001
109 0x78 (x) : 5001 (100.00%)
109 0x78 (x) : 5001 (100.00%)
110 chunks size : 59302280
110 chunks size : 59230936
111 0x78 (x) : 59302280 (100.00%)
111 0x78 (x) : 59230936 (100.00%)
112
112
113 avg chain length : 17
113 avg chain length : 17
114 max chain length : 45
114 max chain length : 45
115 max chain reach : 22744720
115 max chain reach : 25326012
116 compression ratio : 29
116 compression ratio : 29
117
117
118 uncompressed data size (min/max/avg) : 346468 / 346472 / 346471
118 uncompressed data size (min/max/avg) : 346468 / 346472 / 346471
119 full revision size (min/max/avg) : 200985 / 201050 / 201017
119 full revision size (min/max/avg) : 200897 / 201050 / 200987
120 inter-snapshot size (min/max/avg) : 11598 / 163304 / 30669
120 inter-snapshot size (min/max/avg) : 11598 / 171990 / 29869
121 level-1 (min/max/avg) : 15616 / 163304 / 76581
121 level-1 (min/max/avg) : 14037 / 171990 / 90244
122 level-2 (min/max/avg) : 11602 / 86428 / 41234
122 level-2 (min/max/avg) : 11632 / 84456 / 35654
123 level-3 (min/max/avg) : 11598 / 42390 / 22632
123 level-3 (min/max/avg) : 11598 / 41486 / 21753
124 level-4 (min/max/avg) : 11603 / 19649 / 15492
124 level-4 (min/max/avg) : 11618 / 19913 / 14738
125 delta size (min/max/avg) : 10649 / 105465 / 11063
125 delta size (min/max/avg) : 10649 / 105209 / 11079
126
126
127 deltas against prev : 4167 (86.22%)
127 deltas against prev : 4156 (86.13%)
128 where prev = p1 : 4129 (99.09%)
128 where prev = p1 : 4120 (99.13%)
129 where prev = p2 : 0 ( 0.00%)
129 where prev = p2 : 0 ( 0.00%)
130 other : 38 ( 0.91%)
130 other : 36 ( 0.87%)
131 deltas against p1 : 643 (13.30%)
131 deltas against p1 : 646 (13.39%)
132 deltas against p2 : 23 ( 0.48%)
132 deltas against p2 : 23 ( 0.48%)
133 deltas against other : 0 ( 0.00%)
133 deltas against other : 0 ( 0.00%)
General Comments 0
You need to be logged in to leave comments. Login now