Re: Reduce pack-objects memory footprint?
- From
- Eric Wong <e@80x24.org>
- Date
- Mar 2, 2018, 10:37 UTC
- Message-ID
- <20180302103737.GA22348@80x24.org>
- In-Reply-To
- <CACsJy8AzP9HLc02LbSxBvNM6Dg4FsgRt57SgaNFyT5TBPRq-Zw@mail.gmail.com>
Duy Nguyen <pclouds@gmail.com> wrote:
Show 8 quoted lines
> struct revindex_entry {
> off_t offset;
> unsigned int nr;
> };
>
> We need on entry per object, so 6.5M objects * 16 bytes = 104 MB. If
> we break this struct apart and store two arrays of offset and nr in
> struct packed_git, we save 4 bytes per struct, 26 MB total.Can the offset array can be a union which stores int32_t/uint32_t instead of off_t for projects which never exceed 2/4GB?
Likewise, places object_entry where "unsigned long" and off_t are 64-bit could benefit from being 32-bit. Testing/maintenance overhead could be bad, for those, though.