comparison mercurial/revlog.py @ 23288:2b9bc7963504

revlog: increase I/O bound to 4x the amount of data consumed This doesn't affect normal clones since they'd be bound by the CPU bound below anyway -- it does, however, improve generaldelta clones significantly. This also results in better deltaing for generaldelta clones -- in generaldelta clones, we calculate deltas with respect to the closest base if it has a higher revision number than either parent. If the base is on a significantly different branch, this can result in pointlessly massive deltas. This reduces the number of bases and hence the number of bad deltas. Empirically, for a highly branchy repository, this resulted in an improvement of around 15% to manifest size.
author Siddharth Agarwal <sid0@fb.com>
date Tue, 11 Nov 2014 20:08:19 -0800
parents 426d7f901789
children f7a42f8e82bd
comparison
equal deleted inserted replaced
23287:426d7f901789 23288:2b9bc7963504
1265 1265
1266 # - 'dist' is the distance from the base revision -- bounding it limits 1266 # - 'dist' is the distance from the base revision -- bounding it limits
1267 # the amount of I/O we need to do. 1267 # the amount of I/O we need to do.
1268 # - 'compresseddeltalen' is the sum of the total size of deltas we need 1268 # - 'compresseddeltalen' is the sum of the total size of deltas we need
1269 # to apply -- bounding it limits the amount of CPU we consume. 1269 # to apply -- bounding it limits the amount of CPU we consume.
1270 if (d is None or dist > textlen * 2 or l > textlen or 1270 if (d is None or dist > textlen * 4 or l > textlen or
1271 compresseddeltalen > textlen * 2 or 1271 compresseddeltalen > textlen * 2 or
1272 (self._maxchainlen and chainlen > self._maxchainlen)): 1272 (self._maxchainlen and chainlen > self._maxchainlen)):
1273 text = buildtext() 1273 text = buildtext()
1274 data = self.compress(text) 1274 data = self.compress(text)
1275 l = len(data[1]) + len(data[0]) 1275 l = len(data[1]) + len(data[0])