git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 2/2] merge-recursive: Speed up commit graph construction

From
Fredrik Kuivinen <freku045@student.liu.se>
Date
Feb 2, 2006, 11:43 UTC
Message-ID
<20060202114335.GC8103@c165.ib.student.liu.se>
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
Previous: Fredrik Kuivinen
Message 3 of 3 in “Make merge recursive faster in some cases”
  1. 0/2 Make merge recursive faster in some casesFredrik Kuivinen, Feb 2, 2006
  2. 1/2 merge-recursive: Make use of provided basesFredrik Kuivinen, Feb 2, 2006
  3. 2/2 merge-recursive: Speed up commit graph constructionFredrik Kuivinen, Feb 2, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.