##// END OF EJS Templates
snapshot: consider all snapshots in the parents' chains...
Boris Feld -
r39530:e72130f5 default
parent child Browse files
Show More
@@ -661,12 +661,23 b' def _rawgroups(revlog, p1, p2, cachedelt'
661 yield parents
661 yield parents
662
662
663 if sparse and parents:
663 if sparse and parents:
664 snapshots = collections.defaultdict(list) # map: base-rev: snapshot-rev
664 # See if we can use an existing snapshot in the parent chains to use as
665 # See if we can use an existing snapshot in the parent chains to use as
665 # a base for a new intermediate-snapshot
666 # a base for a new intermediate-snapshot
666 bases = []
667 #
668 # search for snapshot in parents delta chain
669 # map: snapshot-level: snapshot-rev
670 parents_snaps = collections.defaultdict(set)
667 for p in parents:
671 for p in parents:
668 bases.append(deltachain(p)[0])
672 for idx, s in enumerate(deltachain(p)):
669 yield tuple(sorted(bases))
673 if not revlog.issnapshot(s):
674 break
675 parents_snaps[idx].add(s)
676 # Test them as possible intermediate snapshot base
677 # We test them from highest to lowest level. High level one are more
678 # likely to result in small delta
679 for idx, snaps in sorted(parents_snaps.items(), reverse=True):
680 yield tuple(sorted(snaps))
670 # No suitable base found in the parent chain, search if any full
681 # 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
682 # snapshots emitted since parent's base would be a suitable base for an
672 # intermediate snapshot.
683 # intermediate snapshot.
@@ -675,8 +686,7 b' def _rawgroups(revlog, p1, p2, cachedelt'
675 # revisions instead of starting our own. Without such re-use,
686 # revisions instead of starting our own. Without such re-use,
676 # topological branches would keep reopening new full chains. Creating
687 # topological branches would keep reopening new full chains. Creating
677 # more and more snapshot as the repository grow.
688 # more and more snapshot as the repository grow.
678 snapfloor = min(bases) + 1
689 snapfloor = min(parents_snaps[0]) + 1
679 snapshots = collections.defaultdict(list)
680 _findsnapshots(revlog, snapshots, snapfloor)
690 _findsnapshots(revlog, snapshots, snapfloor)
681 yield tuple(snapshots[nullrev])
691 yield tuple(snapshots[nullrev])
682
692
@@ -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=67810463
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=63812493
81 $ hg debugrevlog *
81 $ hg debugrevlog *
82 format : 1
82 format : 1
83 flags : generaldelta
83 flags : generaldelta
@@ -89,39 +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 : 126 ( 2.52%)
92 snapshot : 179 ( 3.58%)
93 lvl-0 : 4 ( 0.08%)
93 lvl-0 : 4 ( 0.08%)
94 lvl-1 : 120 ( 2.40%)
94 lvl-1 : 49 ( 0.98%)
95 lvl-2 : 2 ( 0.04%)
95 lvl-2 : 56 ( 1.12%)
96 deltas : 4875 (97.48%)
96 lvl-3 : 63 ( 1.26%)
97 revision size : 67810463
97 lvl-4 : 7 ( 0.14%)
98 snapshot : 14373347 (21.20%)
98 deltas : 4822 (96.42%)
99 lvl-0 : 804235 ( 1.19%)
99 revision size : 63812493
100 lvl-1 : 13535903 (19.96%)
100 snapshot : 10745878 (16.84%)
101 lvl-2 : 33209 ( 0.05%)
101 lvl-0 : 804204 ( 1.26%)
102 deltas : 53437116 (78.80%)
102 lvl-1 : 4986508 ( 7.81%)
103 lvl-2 : 2858810 ( 4.48%)
104 lvl-3 : 1958906 ( 3.07%)
105 lvl-4 : 137450 ( 0.22%)
106 deltas : 53066615 (83.16%)
103
107
104 chunks : 5001
108 chunks : 5001
105 0x78 (x) : 5001 (100.00%)
109 0x78 (x) : 5001 (100.00%)
106 chunks size : 67810463
110 chunks size : 63812493
107 0x78 (x) : 67810463 (100.00%)
111 0x78 (x) : 63812493 (100.00%)
108
112
109 avg chain length : 18
113 avg chain length : 17
110 max chain length : 45
114 max chain length : 45
111 max chain reach : 25808240
115 max chain reach : 27506743
112 compression ratio : 25
116 compression ratio : 27
113
117
114 uncompressed data size (min/max/avg) : 346468 / 346472 / 346471
118 uncompressed data size (min/max/avg) : 346468 / 346472 / 346471
115 full revision size (min/max/avg) : 201014 / 201116 / 201058
119 full revision size (min/max/avg) : 201007 / 201077 / 201051
116 inter-snapshot size (min/max/avg) : 11623 / 173150 / 111222
120 inter-snapshot size (min/max/avg) : 13223 / 172097 / 56809
117 level-1 (min/max/avg) : 11623 / 173150 / 112799
121 level-1 (min/max/avg) : 13223 / 172097 / 101765
118 level-2 (min/max/avg) : 14151 / 19058 / 16604
122 level-2 (min/max/avg) : 28558 / 85237 / 51050
119 delta size (min/max/avg) : 10649 / 101790 / 10961
123 level-3 (min/max/avg) : 14647 / 41752 / 31093
124 level-4 (min/max/avg) : 18596 / 20760 / 19635
125 delta size (min/max/avg) : 10649 / 104791 / 11005
120
126
121 deltas against prev : 4207 (86.30%)
127 deltas against prev : 4171 (86.50%)
122 where prev = p1 : 4164 (98.98%)
128 where prev = p1 : 4127 (98.95%)
123 where prev = p2 : 0 ( 0.00%)
129 where prev = p2 : 0 ( 0.00%)
124 other : 43 ( 1.02%)
130 other : 44 ( 1.05%)
125 deltas against p1 : 653 (13.39%)
131 deltas against p1 : 633 (13.13%)
126 deltas against p2 : 15 ( 0.31%)
132 deltas against p2 : 18 ( 0.37%)
127 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