From: Nguyen Thai Ngoc Duy <pclouds@gmail.com>
To: Sverre Rabbelier <srabbelier@gmail.com>
Cc: git <git@vger.kernel.org>
Subject: Re: [PATCH] pack-object: trim memory usage a tiny bit
Date: Sat, 7 Aug 2010 10:16:43 +1000 [thread overview]
Message-ID: <AANLkTimEFjRuuO+GnAV7PGe0oPi-Qh37iLS6o3Q8Undw@mail.gmail.com> (raw)
In-Reply-To: <AANLkTingdhx5osnbiLVMyWaauCf1TRiMzcSC76gQRp9B@mail.gmail.com>
On Sat, Aug 7, 2010 at 10:04 AM, Sverre Rabbelier <srabbelier@gmail.com> wrote:
> Heya,
>
> On Fri, Aug 6, 2010 at 19:03, Nguyen Thai Ngoc Duy <pclouds@gmail.com> wrote:
>> struct object_entry is allocated for every object to be packed. So if
>> you do a clone on linux-2.6, you would need 1.6M of those structs, 88
>> bytes each. I cut 8 bytes from each of them.
>
> Sure, that was clear enough. But _how_? What needs to be done to
> retain this? Are there any downsides?
Ah, by packing it tighter using bitfields. There are two fields that
act as boolean, but they use at least one byte each. And enum
object_type, I recall, uses 4 bytes (int), while it only needs 5 bits
(4 bits is enough if OBJ_BAD is not counted). No downsides I know of.
--
Duy
next prev parent reply other threads:[~2010-08-07 0:16 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-06 17:00 [PATCH] pack-object: trim memory usage a tiny bit Nguyễn Thái Ngọc Duy
2010-08-06 23:58 ` Sverre Rabbelier
2010-08-07 0:03 ` Nguyen Thai Ngoc Duy
2010-08-07 0:04 ` Sverre Rabbelier
2010-08-07 0:16 ` Nguyen Thai Ngoc Duy [this message]
2010-08-07 0:18 ` Shawn O. Pearce
2010-08-07 0:21 ` Nguyen Thai Ngoc Duy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=AANLkTimEFjRuuO+GnAV7PGe0oPi-Qh37iLS6o3Q8Undw@mail.gmail.com \
--to=pclouds@gmail.com \
--cc=git@vger.kernel.org \
--cc=srabbelier@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).