]> git.ipfire.org Git - thirdparty/git.git/commit
index-pack --promisor: dedup before checking links
authorJonathan Tan <jonathantanmy@google.com>
Tue, 3 Dec 2024 21:52:54 +0000 (13:52 -0800)
committerJunio C Hamano <gitster@pobox.com>
Mon, 9 Dec 2024 23:53:59 +0000 (08:53 +0900)
commit911d14203c019d52431b1197dcbf44f163eac024
tree6d7c617d1dc926d5314d4e3bee2467c4520dd05e
parentcc01bad4a9f566cf4453c7edd6b433851b0835e2
index-pack --promisor: dedup before checking links

Commit c08589efdc (index-pack: repack local links into promisor packs,
2024-11-01) fixed a bug with what was believed to be a negligible
decrease in performance [1] [2]. But at $DAYJOB, with at least one repo,
it was found that the decrease in performance was very significant.

Looking at the patch, whenever we parse an object in the packfile to
be indexed, we check the targets of all its outgoing links for its
existence. However, this could be optimized by first collecting all such
targets into an oidset (thus deduplicating them) before checking. Teach
Git to do that.

On a certain fetch from the aforementioned repo, this improved
performance from approximately 7 hours to 24m47.815s. This number will
be further reduced in a subsequent patch.

[1] https://lore.kernel.org/git/CAG1j3zGiNMbri8rZNaF0w+yP+6OdMz0T8+8_Wgd1R_p1HzVasg@mail.gmail.com/
[2] https://lore.kernel.org/git/20241105212849.3759572-1-jonathantanmy@google.com/

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/index-pack.c