Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Ellerman <michael@ellerman.id.au>2007-05-30 08:47:09 +0400
committerJunio C Hamano <gitster@pobox.com>2007-06-08 13:37:18 +0400
commit225696af2ceaa2e06345954003eda742a76c4e0a (patch)
treef9f2b75869094f67d832cfd22377ed7f830f8e54 /contrib/gitview
parent709b148a907e68bfb57808de8f65b186cc9a5e21 (diff)
gitview: Define __slots__ for Commit
Define __slots__ for the Commit class. This reserves space in each Commit object for only the defined variables. On my system this reduces heap usage when viewing a kernel repo by 12% ~= 55868 KB. Signed-off-by: Michael Ellerman <michael@ellerman.id.au> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib/gitview')
-rwxr-xr-xcontrib/gitview/gitview3
1 files changed, 3 insertions, 0 deletions
diff --git a/contrib/gitview/gitview b/contrib/gitview/gitview
index 7e1d68d167..098cb01353 100755
--- a/contrib/gitview/gitview
+++ b/contrib/gitview/gitview
@@ -263,6 +263,9 @@ class Commit(object):
""" This represent a commit object obtained after parsing the git-rev-list
output """
+ __slots__ = ['children_sha1', 'message', 'author', 'date', 'committer',
+ 'commit_date', 'commit_sha1', 'parent_sha1']
+
children_sha1 = {}
def __init__(self, commit_lines):