From: Michael Ellerman Date: Wed, 30 May 2007 04:47:09 +0000 (+1000) Subject: gitview: Define __slots__ for Commit X-Git-Tag: v1.5.3-rc0~146 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=225696af2ceaa2e06345954003eda742a76c4e0a;p=git.git 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 Signed-off-by: Junio C Hamano --- diff --git a/contrib/gitview/gitview b/contrib/gitview/gitview index 7e1d68d16..098cb0135 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):