Mercurial > hg
diff mercurial/phases.py @ 51582:d8287e43540f
phases: stop using `repo.set` in `remotephasessummary`
The `repository.set` create changectx on the fly, an expensive operation. Using
`repo.revs` and a direct rev-num → node-id translation will be significantly
faster.
This is especially true as we prepare ourself to no longer do the rev-num →
node-id transalation there.
The speedup is a bit lost in the overall noisyness of the slow phase discovery algorithm, but it save a small amount of time in my benchmark.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Fri, 05 Apr 2024 12:24:47 +0200 |
parents | e0194b3ea312 |
children | 22cc679a7312 |
line wrap: on
line diff
--- a/mercurial/phases.py Fri Apr 05 12:02:43 2024 +0200 +++ b/mercurial/phases.py Fri Apr 05 12:24:47 2024 +0200 @@ -1154,8 +1154,8 @@ self.publicheads = [to_node(r) for r in heads] self.draftroots = [to_node(r) for r in roots] # Get the list of all "heads" revs draft on remote - dheads = unfi.set(b'heads(%ld::%ld)', roots, remote_subset) - self.draftheads = [c.node() for c in dheads] + dheads = unfi.revs(b'heads(%ld::%ld)', roots, remote_subset) + self.draftheads = [to_node(r) for r in dheads] def new_heads(