From 6e670b3f0c3b80a9d417d5fef36904a21161587a Mon Sep 17 00:00:00 2001 From: Arijit Banerjee Date: Mon, 1 Jun 2026 16:13:21 +0000 Subject: [PATCH 1/3] 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, direct index-pack timings on single-pack Linux fixtures improved as follows: linux blobless: 69.17s -> 57.98s (16.2% faster), RSS flat linux full: 280.72s -> 236.32s (15.8% faster), RSS +1.9% Five-repeat medians on public repositories also improved: git.git: 12.31s -> 10.70s (13.1% faster) libgit2: 3.35s -> 2.88s (14.0% faster) redis: 6.52s -> 5.64s (13.5% faster) cpython: 33.02s -> 31.44s (4.8% faster) The standard p5302 perf test on a smaller git.git fixture was neutral: 5302.9 index-pack default threads: 11.21(38.07+1.33) -> 11.16(37.90+1.31), -0.4% t/t5302-pack-index.sh passed, and GitGitGadget's linux-leaks CI also exercised that test under SANITIZE=leak. Signed-off-by: Arijit Banerjee Signed-off-by: Junio C Hamano --- builtin/index-pack.c | 1 - 1 file changed, 1 deletion(-) diff --git a/builtin/index-pack.c b/builtin/index-pack.c index cf0bd8280dca83..027c64b522ebb2 100644 --- a/builtin/index-pack.c +++ b/builtin/index-pack.c @@ -1212,7 +1212,6 @@ static void *threaded_second_pass(void *data) list_add(&child->list, &work_head); base_cache_used += child->size; prune_base_data(NULL); - free_base_data(child); } else if (child) { /* * This child does not have its own children. It may be From 522ea8ef7d8511e63e480596c6caa58491b8946d Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Wed, 17 Jun 2026 10:11:13 +0000 Subject: [PATCH 2/3] osxkeychain: fix build with Rust Without NO_RUST defined, the varint encoder/decoder lives in the RUST_LIB, which needs to be linked. Symptom: cc [... -o contrib/credential/osxkeychain/git-credential-osxkeychain [...] Undefined symbols for architecture x86_64: "_decode_varint", referenced from: _read_untracked_extension in libgit.a[x86_64][63](dir.o) _read_untracked_extension in libgit.a[x86_64][63](dir.o) _read_one_dir in libgit.a[x86_64][63](dir.o) _read_one_dir in libgit.a[x86_64][63](dir.o) _load_cache_entry_block in libgit.a[x86_64][174](read-cache.o) "_encode_varint", referenced from: _write_untracked_extension in libgit.a[x86_64][63](dir.o) _write_untracked_extension in libgit.a[x86_64][63](dir.o) _write_untracked_extension in libgit.a[x86_64][63](dir.o) _write_one_dir in libgit.a[x86_64][63](dir.o) _write_one_dir in libgit.a[x86_64][63](dir.o) _do_write_index in libgit.a[x86_64][174](read-cache.o) ld: symbol(s) not found for architecture x86_64 While it is curious why these functions are needed at all (osxkeychain does not read or write the index), the compile error is a real problem. Instead of trying to play games to add `GITLIBS` while filtering out `common-main.o`, replace the `$(LIB_FILE) $(EXTLIBS)` construct with the much shorter `$(LIBS)` construct that _already_ filters out `common-main.o` and adds the Rust library when needed. Signed-off-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index cedc234173e377..0a99b4330c06de 100644 --- a/Makefile +++ b/Makefile @@ -4084,7 +4084,7 @@ contrib/libgit-sys/libgitpub.a: $(LIBGIT_HIDDEN_EXPORT) contrib/credential/osxkeychain/git-credential-osxkeychain: contrib/credential/osxkeychain/git-credential-osxkeychain.o $(LIB_FILE) GIT-LDFLAGS $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) \ - $(filter %.o,$^) $(LIB_FILE) $(EXTLIBS) -framework Security -framework CoreFoundation + $(filter %.o,$^) $(LIBS) -framework Security -framework CoreFoundation contrib/credential/osxkeychain/git-credential-osxkeychain.o: contrib/credential/osxkeychain/git-credential-osxkeychain.c GIT-CFLAGS $(QUIET_LINK)$(CC) -o $@ -c $(dep_args) $(compdb_args) $(ALL_CFLAGS) $(EXTRA_CPPFLAGS) $< From 4621f8ce5e9b97aa2e8d0d9ffe9d25df2471074d Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Wed, 17 Jun 2026 05:38:52 -0700 Subject: [PATCH 3/3] Git 2.55-rc1 Signed-off-by: Junio C Hamano --- Documentation/RelNotes/2.55.0.adoc | 5 +++++ GIT-VERSION-GEN | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Documentation/RelNotes/2.55.0.adoc b/Documentation/RelNotes/2.55.0.adoc index b2adfe51bf19e4..37f7a610a29b09 100644 --- a/Documentation/RelNotes/2.55.0.adoc +++ b/Documentation/RelNotes/2.55.0.adoc @@ -204,6 +204,10 @@ Performance, Internal Implementation, Development Support etc. rewritten to use the right repository structure instance in the unpack-trees.c codepath. + * "git index-pack" has been optimized by retaining child bases in the + delta cache instead of immediately freeing them, letting the existing + cache limit policy decide eviction. + Fixes since v2.54 ----------------- @@ -409,3 +413,4 @@ Fixes since v2.54 (merge 83e7f3bd2b kh/free-commit-list later to maint). (merge d1b72b29e9 am/doc-tech-hash-typofix later to maint). (merge 014c454799 ak/typofixes later to maint). + (merge 522ea8ef7d js/osxkeychain-build-wo-rust later to maint). diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN index 9448079974b61c..9bcfdb576eaf5b 100755 --- a/GIT-VERSION-GEN +++ b/GIT-VERSION-GEN @@ -1,6 +1,6 @@ #!/bin/sh -DEF_VER=v2.55.0-rc0 +DEF_VER=v2.55.0-rc1 LF=' '