##// END OF EJS Templates
perf: add a lazydeltabase option to perfrevlogwrite...
Boris Feld -
r40591:4756a33d default
parent child Browse files
Show More
@@ -1573,6 +1573,7 b' def perfrevlogrevisions(ui, repo, file_='
1573 (b'', b'count', 3, b'last revision to write'),
1573 (b'', b'count', 3, b'last revision to write'),
1574 (b'', b'details', False, b'print timing for every revisions tested'),
1574 (b'', b'details', False, b'print timing for every revisions tested'),
1575 (b'', b'source', b'full', b'the kind of data feed in the revlog'),
1575 (b'', b'source', b'full', b'the kind of data feed in the revlog'),
1576 (b'', b'lazydeltabase', True, b'try the provided delta first'),
1576 ],
1577 ],
1577 b'-c|-m|FILE')
1578 b'-c|-m|FILE')
1578 def perfrevlogwrite(ui, repo, file_=None, startrev=1000, stoprev=-1, **opts):
1579 def perfrevlogwrite(ui, repo, file_=None, startrev=1000, stoprev=-1, **opts):
@@ -1595,6 +1596,7 b' def perfrevlogwrite(ui, repo, file_=None'
1595 if stoprev < 0:
1596 if stoprev < 0:
1596 stoprev = rllen + stoprev
1597 stoprev = rllen + stoprev
1597
1598
1599 lazydeltabase = opts['lazydeltabase']
1598 source = opts['source']
1600 source = opts['source']
1599 validsource = (b'full', b'parent-1', b'parent-2', b'parent-smallest',
1601 validsource = (b'full', b'parent-1', b'parent-2', b'parent-smallest',
1600 b'storage')
1602 b'storage')
@@ -1607,7 +1609,8 b' def perfrevlogwrite(ui, repo, file_=None'
1607 raise error.Abort('invalide run count: %d' % count)
1609 raise error.Abort('invalide run count: %d' % count)
1608 allresults = []
1610 allresults = []
1609 for c in range(count):
1611 for c in range(count):
1610 timing = _timeonewrite(ui, rl, source, startrev, stoprev, c + 1)
1612 timing = _timeonewrite(ui, rl, source, startrev, stoprev, c + 1,
1613 lazydeltabase=lazydeltabase)
1611 allresults.append(timing)
1614 allresults.append(timing)
1612
1615
1613 ### consolidate the results in a single list
1616 ### consolidate the results in a single list
@@ -1670,10 +1673,12 b' class _faketr(object):'
1670 def add(s, x, y, z=None):
1673 def add(s, x, y, z=None):
1671 return None
1674 return None
1672
1675
1673 def _timeonewrite(ui, orig, source, startrev, stoprev, runidx=None):
1676 def _timeonewrite(ui, orig, source, startrev, stoprev, runidx=None,
1677 lazydeltabase=True):
1674 timings = []
1678 timings = []
1675 tr = _faketr()
1679 tr = _faketr()
1676 with _temprevlog(ui, orig, startrev) as dest:
1680 with _temprevlog(ui, orig, startrev) as dest:
1681 dest._lazydeltabase = lazydeltabase
1677 revs = list(orig.revs(startrev, stoprev))
1682 revs = list(orig.revs(startrev, stoprev))
1678 total = len(revs)
1683 total = len(revs)
1679 topic = 'adding'
1684 topic = 'adding'
General Comments 0
You need to be logged in to leave comments. Login now