git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Fredrik Kuivinen <freku045@student.liu.se>
To: git@vger.kernel.org
Cc: junkio@cox.net
Subject: [PATCH 2/2] merge-recursive: Speed up commit graph construction
Date: Thu, 2 Feb 2006 12:43:35 +0100	[thread overview]
Message-ID: <20060202114335.GC8103@c165.ib.student.liu.se> (raw)
In-Reply-To: <20060202113848.GA8103@c165.ib.student.liu.se>

Use __slots__ to speed up construction and decrease memory consumption
of the Commit objects.

Signed-off-by: Fredrik Kuivinen <freku045@student.liu.se>


---

 gitMergeCommon.py |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

23aa79d4e86761e049bc44b5106cd45355045174
diff --git a/gitMergeCommon.py b/gitMergeCommon.py
index ff6f58a..fdbf9e4 100644
--- a/gitMergeCommon.py
+++ b/gitMergeCommon.py
@@ -107,7 +107,10 @@ def isSha(obj):
     return (type(obj) is str and bool(shaRE.match(obj))) or \
            (type(obj) is int and obj >= 1)
 
-class Commit:
+class Commit(object):
+    __slots__ = ['parents', 'firstLineMsg', 'children', '_tree', 'sha',
+                 'virtual']
+
     def __init__(self, sha, parents, tree=None):
         self.parents = parents
         self.firstLineMsg = None
-- 
1.1.6.gc78e-dirty

      parent reply	other threads:[~2006-02-02 11:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-02 11:38 [PATCH 0/2] Make merge recursive faster in some cases Fredrik Kuivinen
2006-02-02 11:43 ` [PATCH 1/2] merge-recursive: Make use of provided bases Fredrik Kuivinen
2006-02-02 11:43 ` Fredrik Kuivinen [this message]

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=20060202114335.GC8103@c165.ib.student.liu.se \
    --to=freku045@student.liu.se \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    /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).