comparison mercurial/obsutil.py @ 51933:8583d138f436

exchange: improve computation of relevant markers for large repos Compute the candidate nodes with relevant markers directly from keys of the predecessors/successors/children dictionaries of obsstore. This is faster than iterating over all nodes directly. This test could be further improved for repositories with relative few markers compared to the repository size, but this is no longer hot already. With the current loop structure, the obshashrange use works as well as before as it passes lists with a single node. Adjust the interface by allowing revision lists as well as node lists. This helps cases that computes ancestors as it reduces the materialisation cost. Use this in _pushdiscoveryobsmarker and _getbundleobsmarkerpart. Improve the latter further by directly using ancestors(). Performance benchmarks show notable and welcome improvement to no-op push and pull (that would also apply to other push/pull). This apply to push and pull done without evolve. ### push/pull Benchmark parameter # bin-env-vars.hg.flavor = default # benchmark.variants.explicit-rev = none # benchmark.variants.protocol = ssh # benchmark.variants.revs = none ## benchmark.name = hg.command.pull # data-env-vars.name = mercurial-devel-2024-03-22-zstd-sparse-revlog before: 5.968537 seconds after: 5.668507 seconds (-5.03%, -0.30) # data-env-vars.name = tryton-devel-2024-03-22-zstd-sparse-revlog before: 1.446232 seconds after: 0.835553 seconds (-42.23%, -0.61) # data-env-vars.name = netbsd-src-draft-2024-09-19-zstd-sparse-revlog before: 5.777412 seconds after: 2.523454 seconds (-56.32%, -3.25) ## benchmark.name = hg.command.push # data-env-vars.name = mercurial-devel-2024-03-22-zstd-sparse-revlog before: 6.155501 seconds after: 5.885072 seconds (-4.39%, -0.27) # data-env-vars.name = tryton-devel-2024-03-22-zstd-sparse-revlog before: 1.491054 seconds after: 0.934882 seconds (-37.30%, -0.56) # data-env-vars.name = netbsd-src-draft-2024-09-19-zstd-sparse-revlog before: 5.902494 seconds after: 2.957644 seconds (-49.89%, -2.94) There is not notable different in these result using the "rust" flavor instead of the "default". The performance impact on the same operation when using evolve were also tested and no impact was noted.
author Joerg Sonnenberger <joerg@bec.de>
date Mon, 08 Jul 2024 22:46:04 +0200
parents f4733654f144
children 5cc8deb96b48
comparison
equal deleted inserted replaced
51932:ee7e106b372b 51933:8583d138f436
107 if nodes is None: 107 if nodes is None:
108 rawmarkers = repo.obsstore 108 rawmarkers = repo.obsstore
109 elif exclusive: 109 elif exclusive:
110 rawmarkers = exclusivemarkers(repo, nodes) 110 rawmarkers = exclusivemarkers(repo, nodes)
111 else: 111 else:
112 rawmarkers = repo.obsstore.relevantmarkers(nodes) 112 rawmarkers = repo.obsstore.relevantmarkers(nodes=nodes)
113 113
114 for markerdata in rawmarkers: 114 for markerdata in rawmarkers:
115 yield marker(repo, markerdata) 115 yield marker(repo, markerdata)
116 116
117 117