[PATCH 5 of 5] show: document why accidentally quadratic is (probably) acceptable

Gregory Szorc gregory.szorc at gmail.com
Tue Jul 4 00:32:41 EDT 2017


# HG changeset patch
# User Gregory Szorc <gregory.szorc at gmail.com>
# Date 1499142399 25200
#      Mon Jul 03 21:26:39 2017 -0700
# Node ID 43ea32fe0c696b2ff2abebdc5a5eab67c1653185
# Parent  b34900769c27a137fa31b86d88d9e09e29f15d4a
show: document why accidentally quadratic is (probably) acceptable

diff --git a/hgext/show.py b/hgext/show.py
--- a/hgext/show.py
+++ b/hgext/show.py
@@ -215,6 +215,11 @@ def showstack(ui, repo, displayer):
 
         stackrevs.add(ctx.rev())
 
+        # ctx.children() within a function iterating on descandants
+        # potentially has severe performance concerns because revlog.children()
+        # iterates over all revisions after ctx's node. However, the number of
+        # draft changesets should be a reasonably small number. So even if
+        # this is quadratic, the perf impact should be minimal.
         if len(ctx.children()) > 1:
             branchpointattip = True
             break


More information about the Mercurial-devel mailing list