@matheusbsbs / matheus-bagliano / commits / 225696af2c
Fork 0

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>

Michael Ellerman committed May 30, 2007 at 14:47 UTC 225696af2ceaa2e06345954003eda742a76c4e0a
1 file changed +3
contrib/gitview/gitview
+3
@@ -263,6 +263,9 @@ class Commit(object):
263 """ This represent a commit object obtained after parsing the git-rev-list
264 output """
265
266 + __slots__ = ['children_sha1', 'message', 'author', 'date', 'committer',
267 + 'commit_date', 'commit_sha1', 'parent_sha1']
268 +
269 children_sha1 = {}
270
271 def __init__(self, commit_lines):