D5583: discovery: using the new basesheads()

gracinet (Georges Racinet) phabricator at mercurial-scm.org
Tue Jan 15 02:14:49 UTC 2019


gracinet created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Our ultimate goal is to switch eventually to a Rust implementation, but
  this move actually seems to increase the performance in a pure Python
  build.
  
  What follows is a quick measurement done on PyPy on repos prepared with
  `contrib/discovery-helper.sh 50 100`.
  
  Before:
  ! wall 0.894384 comb 0.890000 user 0.890000 sys 0.000000 (best of 11)
  ! wall 0.971199 comb 0.970000 user 0.950000 sys 0.020000 (max of 11)
  ! wall 0.927993 comb 0.925455 user 0.919091 sys 0.006364 (avg of 11)
  ! wall 0.921619 comb 0.920000 user 0.910000 sys 0.010000 (median of 11)
  
  After:
  ! wall 0.614278 comb 0.610000 user 0.610000 sys 0.000000 (best of 14)
  ! wall 0.789459 comb 0.790000 user 0.770000 sys 0.020000 (max of 14)
  ! wall 0.722765 comb 0.720000 user 0.715714 sys 0.004286 (avg of 14)
  ! wall 0.734448 comb 0.720000 user 0.720000 sys 0.000000 (median of 14)

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D5583

AFFECTED FILES
  mercurial/setdiscovery.py

CHANGE DETAILS

diff --git a/mercurial/setdiscovery.py b/mercurial/setdiscovery.py
--- a/mercurial/setdiscovery.py
+++ b/mercurial/setdiscovery.py
@@ -229,9 +229,7 @@
         """the heads of the known common set"""
         # heads(common) == heads(common.bases) since common represents
         # common.bases and all its ancestors
-        # The presence of nullrev will confuse heads(). So filter it out.
-        return set(self._repo.revs('heads(%ld)',
-                   self._common.bases - {nullrev}))
+        return self._common.basesheads()
 
 def findcommonheads(ui, local, remote,
                     initialsamplesize=100,



To: gracinet, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list