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>
This commit is contained in:
Michael Ellerman 2007-05-30 14:47:09 +10:00 коммит произвёл Junio C Hamano
Родитель 709b148a90
Коммит 225696af2c
1 изменённых файлов: 3 добавлений и 0 удалений

Просмотреть файл

@ -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):