Re: Reduce pack-objects memory footprint?
From: Eric Wong <hidden>
Date: 2018-03-02 10:37:48
From: Eric Wong <hidden>
Date: 2018-03-02 10:37:48
Duy Nguyen [off-list ref] wrote:
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.