# HG changeset patch # User Pierre-Yves David # Date 1393355677 28800 # Node ID 60dd0c4010342eee6cb677ea14cdf37fa4118277 # Parent acfa2b67cff64fdef593a1e5574f7ea99001b1a1 drophack: major speedup to marker stripping It appear that each call to obsstore.add have a significant overhead (in particular the creation of a set form the list of markers and file system operation to the obsstore file. We now compute the marker we need to store and write them in a single call. diff -r acfa2b67cff6 -r 60dd0c401034 hgext/drophack.py --- a/hgext/drophack.py Mon Feb 24 19:01:12 2014 -0800 +++ b/hgext/drophack.py Tue Feb 25 11:14:37 2014 -0800 @@ -71,11 +71,10 @@ del repo.obsstore # drop the cache newstore = repo.obsstore assert not newstore # should be empty after rename + newmarkers = [m for m in oldmarkers if m not in markers] tr = repo.transaction('drophack') try: - for m in oldmarkers: - if m not in markers: - newstore.add(tr, [m]) + newstore.add(tr, newmarkers) tr.close() finally: tr.release() diff -r acfa2b67cff6 -r 60dd0c401034 tests/test-drop.t --- a/tests/test-drop.t Mon Feb 24 19:01:12 2014 -0800 +++ b/tests/test-drop.t Tue Feb 25 11:14:37 2014 -0800 @@ -236,7 +236,7 @@ search nodes: wall * comb * user * sys * (glob) 2 nodes found strip obsmarker: wall * comb * user * sys * (glob) - saved backup bundle to $TESTTMP/repo/.hg/strip-backup/a2c06c884bfe-drophack.hg (glob) + saved backup bundle to $TESTTMP/repo/.hg/strip-backup/*-drophack.hg (glob) strip nodes: wall * comb * user * sys * (glob) $ summary ============ graph ==============