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=59 |
|
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 : 16 |
|
92 | snapshot : 176 ( 3.52%) | |
93 |
lvl-0 : |
|
93 | lvl-0 : 3 ( 0.06%) | |
94 |
lvl-1 : 1 |
|
94 | lvl-1 : 17 ( 0.34%) | |
95 |
lvl-2 : |
|
95 | lvl-2 : 45 ( 0.90%) | |
96 |
lvl-3 : 5 |
|
96 | lvl-3 : 56 ( 1.12%) | |
97 |
lvl-4 : 5 |
|
97 | lvl-4 : 55 ( 1.10%) | |
98 |
deltas : 48 |
|
98 | deltas : 4825 (96.48%) | |
99 |
revision size : 59 |
|
99 | revision size : 59230936 | |
100 |
snapshot : 5 |
|
100 | snapshot : 5770371 ( 9.74%) | |
101 |
lvl-0 : |
|
101 | lvl-0 : 602962 ( 1.02%) | |
102 |
lvl-1 : 1 |
|
102 | lvl-1 : 1534153 ( 2.59%) | |
103 |
lvl-2 : 160 |
|
103 | lvl-2 : 1604445 ( 2.71%) | |
104 |
lvl-3 : 12 |
|
104 | lvl-3 : 1218174 ( 2.06%) | |
105 |
lvl-4 : 8 |
|
105 | lvl-4 : 810637 ( 1.37%) | |
106 |
deltas : 5346 |
|
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 : 59 |
|
110 | chunks size : 59230936 | |
111 |
0x78 (x) : 59 |
|
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 : 2 |
|
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) : 200 |
|
119 | full revision size (min/max/avg) : 200897 / 201050 / 200987 | |
120 |
inter-snapshot size (min/max/avg) : 11598 / 1 |
|
120 | inter-snapshot size (min/max/avg) : 11598 / 171990 / 29869 | |
121 |
level-1 (min/max/avg) : 1 |
|
121 | level-1 (min/max/avg) : 14037 / 171990 / 90244 | |
122 |
level-2 (min/max/avg) : 116 |
|
122 | level-2 (min/max/avg) : 11632 / 84456 / 35654 | |
123 |
level-3 (min/max/avg) : 11598 / 4 |
|
123 | level-3 (min/max/avg) : 11598 / 41486 / 21753 | |
124 |
level-4 (min/max/avg) : 116 |
|
124 | level-4 (min/max/avg) : 11618 / 19913 / 14738 | |
125 |
delta size (min/max/avg) : 10649 / 105 |
|
125 | delta size (min/max/avg) : 10649 / 105209 / 11079 | |
126 |
|
126 | |||
127 |
deltas against prev : 416 |
|
127 | deltas against prev : 4156 (86.13%) | |
128 |
where prev = p1 : 412 |
|
128 | where prev = p1 : 4120 (99.13%) | |
129 | where prev = p2 : 0 ( 0.00%) |
|
129 | where prev = p2 : 0 ( 0.00%) | |
130 |
other : 3 |
|
130 | other : 36 ( 0.87%) | |
131 |
deltas against p1 : 64 |
|
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