Files
restic/changelog
Matthias Dötsch e428de5f84 Reduce in-memory index entry size by storing packIndex as uint32
Each blob in a repository requires one index entry in memory, which is one
of the largest contributors to restic's memory usage. The indexEntry.packIndex
field, an index into the per-Index packs slice, was stored as a machine-word
int (8 bytes on amd64) although the value is always a small array index.

Store it as a uint32 instead. This shrinks indexEntry from 64 to 56 bytes on
64-bit platforms (56 % 8 == 0, so no padding is added), reducing index memory
by roughly 12% -- about 100 MB for a repository with ~13 million blobs, as
confirmed by profiling. uint32 allows 4.29 billion packs (>30 billion blobs at
the assumed 8 blobs/pack), far beyond any real repository; addToPacks guards
against overflow defensively. The on-disk repository format is unaffected.
2026-07-08 06:01:15 +00:00
..
2021-08-21 12:16:04 +02:00
2023-12-06 13:11:55 +01:00
2023-12-06 13:11:55 +01:00
2023-12-06 13:11:55 +01:00
2018-06-10 11:29:57 +02:00
2023-12-06 13:11:55 +01:00
2023-12-06 13:11:55 +01:00
2024-03-11 14:35:12 +08:00
2023-10-27 19:48:00 +02:00
2025-09-06 21:59:11 +02:00
2024-01-08 21:33:05 +01:00