@matheusbsbs / matheus-bagliano / commits / 97f58b785d
Fork 0

merge-recursive: Speed up commit graph construction

Use __slots__ to speed up construction and decrease memory consumption of the Commit objects. Signed-off-by: Fredrik Kuivinen <freku045@student.liu.se> Signed-off-by: Junio C Hamano <junkio@cox.net>

Fredrik Kuivinen committed Feb 2, 2006 at 12:43 UTC 97f58b785d6c5c86b52a365b0086b5b098f5ee97
1 file changed +4 -1
gitMergeCommon.py
+4 -1
@@ -107,7 +107,10 @@ def isSha(obj):
107 return (type(obj) is str and bool(shaRE.match(obj))) or \
108 (type(obj) is int and obj >= 1)
109
110 -class Commit:
110 +class Commit(object):
111 + __slots__ = ['parents', 'firstLineMsg', 'children', '_tree', 'sha',
112 + 'virtual']
113 +
114 def __init__(self, sha, parents, tree=None):
115 self.parents = parents
116 self.firstLineMsg = None