Skip to content

Commit ecd04fa

Browse files
author
Arijit Banerjee
committed
index-pack: retain child bases in delta cache
When resolving a delta whose result has children of its own, index-pack adds the result to work_head, accounts its data in base_cache_used, and calls prune_base_data(). It then immediately frees that same data. This bypasses the existing delta base cache policy and can force later descendants to reconstruct the queued base again. Let the existing delta_base_cache_limit pruning policy decide whether to keep or evict the data instead. This does not add a new cache or increase the cache limit. The object data is already accounted in base_cache_used before prune_base_data() runs, and the existing pruning and base cleanup paths still release it. On a quiet Ubuntu 24.04 VM with 16 vCPUs, 32 GiB RAM, and local SSD, standard p5302-pack-index.sh runs improved as follows: libgit2: 3.17(11.42+0.61) -> 2.69(10.49+0.32), 15.1% faster redis: 5.88(15.77+0.63) -> 4.98(14.08+0.39), 15.3% faster git.git: 11.22(38.31+1.29) -> 9.69(35.36+0.64), 13.6% faster cpython: 32.64(117.70+4.39) -> 28.70(109.90+1.98), 12.1% faster linux: 276.95(793.14+39.51) -> 234.75(722.33+18.01), 15.2% faster The linux p5302 number is from a single repeat; the others are from the default three repeats. End-to-end local full-clone spot checks also improved: libgit2: 4.99s -> 4.50s, 9.8% faster redis: 8.71s -> 7.90s, 9.3% faster git.git: 24.89s -> 23.57s, 5.3% faster cpython: 58.77s -> 53.84s, 8.4% faster linux: 549.21s -> 515.52s, 6.1% faster t/t5302-pack-index.sh passed, and GitGitGadget's linux-leaks CI also exercised that test under SANITIZE=leak. Signed-off-by: Arijit Banerjee <arijit@effectiveailabs.com>
1 parent c69baaf commit ecd04fa

1 file changed

Lines changed: 0 additions & 1 deletion

File tree

builtin/index-pack.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1212,7 +1212,6 @@ static void *threaded_second_pass(void *data)
12121212
list_add(&child->list, &work_head);
12131213
base_cache_used += child->size;
12141214
prune_base_data(NULL);
1215-
free_base_data(child);
12161215
} else if (child) {
12171216
/*
12181217
* This child does not have its own children. It may be

0 commit comments

Comments
 (0)