##// END OF EJS Templates
snapshot: consider unrelated snapshots at a similar level first...
Boris Feld -
r39531:6a538427 default
parent child Browse files
Show More
@@ -616,9 +616,10 b' def _candidategroups(revlog, textlen, p1'
616 616 def _findsnapshots(revlog, cache, start_rev):
617 617 """find snapshot from start_rev to tip"""
618 618 deltaparent = revlog.deltaparent
619 issnapshot = revlog.issnapshot
619 620 for rev in revlog.revs(start_rev):
620 if deltaparent(rev) == nullrev:
621 cache[nullrev].append(rev)
621 if issnapshot(rev):
622 cache[deltaparent(rev)].append(rev)
622 623
623 624 def _rawgroups(revlog, p1, p2, cachedelta):
624 625 """Provides group of revision to be tested as delta base
@@ -673,11 +674,35 b' def _rawgroups(revlog, p1, p2, cachedelt'
673 674 if not revlog.issnapshot(s):
674 675 break
675 676 parents_snaps[idx].add(s)
677 snapfloor = min(parents_snaps[0]) + 1
678 _findsnapshots(revlog, snapshots, snapfloor)
676 679 # Test them as possible intermediate snapshot base
677 680 # We test them from highest to lowest level. High level one are more
678 681 # likely to result in small delta
682 floor = None
679 683 for idx, snaps in sorted(parents_snaps.items(), reverse=True):
684 siblings = set()
685 for s in snaps:
686 siblings.update(snapshots[s])
687 # Before considering making a new intermediate snapshot, we check
688 # if an existing snapshot, children of base we consider, would be
689 # suitable.
690 #
691 # It give a change to reuse a delta chain "unrelated" to the
692 # current revision instead of starting our own. Without such
693 # re-use, topological branches would keep reopening new chains.
694 # Creating more and more snapshot as the repository grow.
695
696 if floor is not None:
697 # We only do this for siblings created after the one in our
698 # parent's delta chain. Those created before has less chances
699 # to be valid base since our ancestors had to create a new
700 # snapshot.
701 siblings = [r for r in siblings if floor < r]
702 yield tuple(sorted(siblings))
703 # then test the base from our parent's delta chain.
680 704 yield tuple(sorted(snaps))
705 floor = min(snaps)
681 706 # No suitable base found in the parent chain, search if any full
682 707 # snapshots emitted since parent's base would be a suitable base for an
683 708 # intermediate snapshot.
@@ -686,8 +711,6 b' def _rawgroups(revlog, p1, p2, cachedelt'
686 711 # revisions instead of starting our own. Without such re-use,
687 712 # topological branches would keep reopening new full chains. Creating
688 713 # more and more snapshot as the repository grow.
689 snapfloor = min(parents_snaps[0]) + 1
690 _findsnapshots(revlog, snapshots, snapfloor)
691 714 yield tuple(snapshots[nullrev])
692 715
693 716 # other approach failed try against prev to hopefully save us a
@@ -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=63812493
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=59303048
81 81 $ hg debugrevlog *
82 82 format : 1
83 83 flags : generaldelta
@@ -89,45 +89,45 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 : 179 ( 3.58%)
92 snapshot : 165 ( 3.30%)
93 93 lvl-0 : 4 ( 0.08%)
94 lvl-1 : 49 ( 0.98%)
95 lvl-2 : 56 ( 1.12%)
96 lvl-3 : 63 ( 1.26%)
97 lvl-4 : 7 ( 0.14%)
98 deltas : 4822 (96.42%)
99 revision size : 63812493
100 snapshot : 10745878 (16.84%)
101 lvl-0 : 804204 ( 1.26%)
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%)
94 lvl-1 : 17 ( 0.34%)
95 lvl-2 : 46 ( 0.92%)
96 lvl-3 : 62 ( 1.24%)
97 lvl-4 : 36 ( 0.72%)
98 deltas : 4836 (96.70%)
99 revision size : 59303048
100 snapshot : 6105443 (10.30%)
101 lvl-0 : 804187 ( 1.36%)
102 lvl-1 : 1476228 ( 2.49%)
103 lvl-2 : 1752567 ( 2.96%)
104 lvl-3 : 1461776 ( 2.46%)
105 lvl-4 : 610685 ( 1.03%)
106 deltas : 53197605 (89.70%)
107 107
108 108 chunks : 5001
109 109 0x78 (x) : 5001 (100.00%)
110 chunks size : 63812493
111 0x78 (x) : 63812493 (100.00%)
110 chunks size : 59303048
111 0x78 (x) : 59303048 (100.00%)
112 112
113 113 avg chain length : 17
114 114 max chain length : 45
115 max chain reach : 27506743
116 compression ratio : 27
115 max chain reach : 26194433
116 compression ratio : 29
117 117
118 118 uncompressed data size (min/max/avg) : 346468 / 346472 / 346471
119 full revision size (min/max/avg) : 201007 / 201077 / 201051
120 inter-snapshot size (min/max/avg) : 13223 / 172097 / 56809
121 level-1 (min/max/avg) : 13223 / 172097 / 101765
122 level-2 (min/max/avg) : 28558 / 85237 / 51050
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
119 full revision size (min/max/avg) : 200992 / 201080 / 201046
120 inter-snapshot size (min/max/avg) : 11610 / 172762 / 32927
121 level-1 (min/max/avg) : 15619 / 172762 / 86836
122 level-2 (min/max/avg) : 13055 / 85219 / 38099
123 level-3 (min/max/avg) : 11610 / 42645 / 23577
124 level-4 (min/max/avg) : 12928 / 20205 / 16963
125 delta size (min/max/avg) : 10649 / 106863 / 11000
126 126
127 deltas against prev : 4171 (86.50%)
128 where prev = p1 : 4127 (98.95%)
127 deltas against prev : 4162 (86.06%)
128 where prev = p1 : 4120 (98.99%)
129 129 where prev = p2 : 0 ( 0.00%)
130 other : 44 ( 1.05%)
131 deltas against p1 : 633 (13.13%)
132 deltas against p2 : 18 ( 0.37%)
130 other : 42 ( 1.01%)
131 deltas against p1 : 653 (13.50%)
132 deltas against p2 : 21 ( 0.43%)
133 133 deltas against other : 0 ( 0.00%)
General Comments 0
You need to be logged in to leave comments. Login now