Skip to content

Commit 969cc77

Browse files
committed
try to get improved hitrate for delta-cache by using it more, and fail (#851)
This change will put more of the delta-chain into the cache which possibly leads to increased chances of cache-hits if objects aren't queried in random order, but in pack-offset order. Note that in general, it tends to be faster to not use any cache at all. This change was pruned back right away as the major difference to git, which does it by storing every object of the chain in the cache, is that we don't share the cache among threads. This leaves a much smaller per-thread cache size which really is a problem if the objects are large. So instead of slowing pack access down by trying it, with the default cache being unsuitable as it would evict all the time due to memory overruns, we do nothing here and rather improve the performance when dealing with pathological cases during pack traversal.
1 parent 977e135 commit 969cc77

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Diff for: gix-pack/src/data/file/decode/entry.rs

+2
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,8 @@ impl File {
215215
}
216216
break;
217217
}
218+
// This is a pessimistic guess, as worst possible compression should not be bigger than the data itself.
219+
// TODO: is this assumption actually true?
218220
total_delta_data_size += cursor.decompressed_size;
219221
let decompressed_size = cursor
220222
.decompressed_size

0 commit comments

Comments
 (0)