From: "Karl Hasselström" <kha@treskal.com>
To: Catalin Marinas <catalin.marinas@gmail.com>
Cc: git@vger.kernel.org
Subject: [StGIT PATCH 1/4] Speed up the discovery of uninteresting commits
Date: Mon, 13 Aug 2007 23:01:25 +0200 [thread overview]
Message-ID: <20070813210125.25929.80371.stgit@yoghurt> (raw)
In-Reply-To: <20070813205801.25929.34925.stgit@yoghurt>
The operation of discovering uninteresting commits (that is, all the
commits that immediately precede a patch but don't have any patch
among their ancestors) is expensive. Make it less so, by using the
fact that we're done as soon as we've seen all patch commits.
This is probably less of a win than might be naively expected, since
we give the --topo-order flag to git-rev-list, which causes it to have
to read the full DAG to even start producing the output; but at least
we skip quite a bit of looping and set manipulation in Python, which
ought to be worth _something_.
Signed-off-by: Karl Hasselström <kha@treskal.com>
---
stgit/stack.py | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/stgit/stack.py b/stgit/stack.py
index 1b6808e..d3756d0 100644
--- a/stgit/stack.py
+++ b/stgit/stack.py
@@ -472,11 +472,17 @@ class UninterestingCache:
for p in parents:
if not p in interesting:
uninteresting.add(p)
- continue
+
+ # If this is the last patch commit, there is no way we
+ # can encounter any more uninteresting commits.
+ patches.remove(commit)
+ if not patches:
+ break
# Commits with interesting parents are interesting.
- if interesting.intersection(parents):
+ elif interesting.intersection(parents):
interesting.add(commit)
+
self.__uninteresting = uninteresting
out.done()
def create_patch(self, name, top, bottom):
next prev parent reply other threads:[~2007-08-13 21:02 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-13 21:01 [StGIT PATCH 0/4] Optimizations for the DAG appliedness stuff Karl Hasselström
2007-08-13 21:01 ` Karl Hasselström [this message]
2007-08-13 21:01 ` [StGIT PATCH 2/4] Speed up appliedness check during patch creation Karl Hasselström
2007-08-13 21:01 ` [StGIT PATCH 3/4] Don't traverse the whole DAG when looking for uninteresting commits Karl Hasselström
2007-08-13 21:01 ` [StGIT PATCH 4/4] Find uninteresting commits faster for special cases Karl Hasselström
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070813210125.25929.80371.stgit@yoghurt \
--to=kha@treskal.com \
--cc=catalin.marinas@gmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).