]> git.ipfire.org Git - thirdparty/git.git/commit - fetch-pack.c
fetch-pack: drop custom loose object cache
authorJeff King <peff@peff.net>
Mon, 12 Nov 2018 14:55:58 +0000 (09:55 -0500)
committerJunio C Hamano <gitster@pobox.com>
Tue, 13 Nov 2018 05:22:03 +0000 (14:22 +0900)
commit97b2fa08b6b9ee3ebd927bbc208bf5223e5ac849
treedd77ba74f97fa24cc18f7f4da9526125caca8233
parent61c7711cfea250e7ed06839c07189df47fb42de7
fetch-pack: drop custom loose object cache

Commit 024aa4696c (fetch-pack.c: use oidset to check existence of loose
object, 2018-03-14) added a cache to avoid calling stat() for a bunch of
loose objects we don't have.

Now that OBJECT_INFO_QUICK handles this caching itself, we can drop the
custom solution.

Note that this might perform slightly differently, as the original code
stopped calling readdir() when we saw more loose objects than there were
refs. So:

  1. The old code might have spent work on readdir() to fill the cache,
     but then decided there were too many loose objects, wasting that
     effort.

  2. The new code might spend a lot of time on readdir() if you have a
     lot of loose objects, even though there are very few objects to
     ask about.

In practice it probably won't matter either way; see the previous commit
for some discussion of the tradeoff.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
fetch-pack.c