##// END OF EJS Templates
snapshot: search for unrelated but reusable full-snapshot...
Boris Feld -
r39529:3ca144f1 default
parent child Browse files
Show More
@@ -9,6 +9,7 b''
9 9
10 10 from __future__ import absolute_import
11 11
12 import collections
12 13 import heapq
13 14 import struct
14 15
@@ -607,8 +608,18 b' def _candidategroups(revlog, textlen, p1'
607 608 continue
608 609 group.append(rev)
609 610 if group:
611 # XXX: in the sparse revlog case, group can become large,
612 # impacting performances. Some bounding or slicing mecanism
613 # would help to reduce this impact.
610 614 yield tuple(group)
611 615
616 def _findsnapshots(revlog, cache, start_rev):
617 """find snapshot from start_rev to tip"""
618 deltaparent = revlog.deltaparent
619 for rev in revlog.revs(start_rev):
620 if deltaparent(rev) == nullrev:
621 cache[nullrev].append(rev)
622
612 623 def _rawgroups(revlog, p1, p2, cachedelta):
613 624 """Provides group of revision to be tested as delta base
614 625
@@ -656,6 +667,18 b' def _rawgroups(revlog, p1, p2, cachedelt'
656 667 for p in parents:
657 668 bases.append(deltachain(p)[0])
658 669 yield tuple(sorted(bases))
670 # No suitable base found in the parent chain, search if any full
671 # snapshots emitted since parent's base would be a suitable base for an
672 # intermediate snapshot.
673 #
674 # It give a chance to reuse a delta chain unrelated to the current
675 # revisions instead of starting our own. Without such re-use,
676 # topological branches would keep reopening new full chains. Creating
677 # more and more snapshot as the repository grow.
678 snapfloor = min(bases) + 1
679 snapshots = collections.defaultdict(list)
680 _findsnapshots(revlog, snapshots, snapfloor)
681 yield tuple(snapshots[nullrev])
659 682
660 683 # other approach failed try against prev to hopefully save us a
661 684 # fulltext.
@@ -77,7 +77,7 b' repeatedly while some of it changes rare'
77 77
78 78
79 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=72315280
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=67810463
81 81 $ hg debugrevlog *
82 82 format : 1
83 83 flags : generaldelta
@@ -89,36 +89,39 b' repeatedly while some of it changes rare'
89 89 empty : 0 ( 0.00%)
90 90 text : 0 (100.00%)
91 91 delta : 0 (100.00%)
92 snapshot : 145 ( 2.90%)
93 lvl-0 : 15 ( 0.30%)
94 lvl-1 : 130 ( 2.60%)
95 deltas : 4856 (97.10%)
96 revision size : 72315280
97 snapshot : 18481085 (25.56%)
98 lvl-0 : 3016019 ( 4.17%)
99 lvl-1 : 15465066 (21.39%)
100 deltas : 53834195 (74.44%)
92 snapshot : 126 ( 2.52%)
93 lvl-0 : 4 ( 0.08%)
94 lvl-1 : 120 ( 2.40%)
95 lvl-2 : 2 ( 0.04%)
96 deltas : 4875 (97.48%)
97 revision size : 67810463
98 snapshot : 14373347 (21.20%)
99 lvl-0 : 804235 ( 1.19%)
100 lvl-1 : 13535903 (19.96%)
101 lvl-2 : 33209 ( 0.05%)
102 deltas : 53437116 (78.80%)
101 103
102 104 chunks : 5001
103 105 0x78 (x) : 5001 (100.00%)
104 chunks size : 72315280
105 0x78 (x) : 72315280 (100.00%)
106 chunks size : 67810463
107 0x78 (x) : 67810463 (100.00%)
106 108
107 109 avg chain length : 18
108 110 max chain length : 45
109 max chain reach : 32095083
110 compression ratio : 23
111 max chain reach : 25808240
112 compression ratio : 25
111 113
112 114 uncompressed data size (min/max/avg) : 346468 / 346472 / 346471
113 full revision size (min/max/avg) : 200990 / 201151 / 201067
114 inter-snapshot size (min/max/avg) : 37202 / 173034 / 118962
115 level-1 (min/max/avg) : 37202 / 173034 / 118962
116 delta size (min/max/avg) : 10649 / 104791 / 11086
115 full revision size (min/max/avg) : 201014 / 201116 / 201058
116 inter-snapshot size (min/max/avg) : 11623 / 173150 / 111222
117 level-1 (min/max/avg) : 11623 / 173150 / 112799
118 level-2 (min/max/avg) : 14151 / 19058 / 16604
119 delta size (min/max/avg) : 10649 / 101790 / 10961
117 120
118 deltas against prev : 4185 (86.18%)
119 where prev = p1 : 4139 (98.90%)
121 deltas against prev : 4207 (86.30%)
122 where prev = p1 : 4164 (98.98%)
120 123 where prev = p2 : 0 ( 0.00%)
121 other : 46 ( 1.10%)
122 deltas against p1 : 647 (13.32%)
123 deltas against p2 : 24 ( 0.49%)
124 other : 43 ( 1.02%)
125 deltas against p1 : 653 (13.39%)
126 deltas against p2 : 15 ( 0.31%)
124 127 deltas against other : 0 ( 0.00%)
General Comments 0
You need to be logged in to leave comments. Login now