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

login
register
mail settings
Submitter Gregory Szorc
Date July 4, 2017, 4:32 a.m.
Message ID <43ea32fe0c696b2ff2ab.1499142761@ubuntu-vm-main>
Download mbox | patch
Permalink /patch/21965/
State Accepted
Headers show

Comments

Gregory Szorc - July 4, 2017, 4:32 a.m.
# HG changeset patch
# User Gregory Szorc <gregory.szorc@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

Patch

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