git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] Use OBJECT_INFO_QUICK to speedup git fetch-pack

From
TITakuto Ikuta <tikuta@google.com>
Date
Nov 27, 2017, 04:27 UTC
Message-ID
<0102015ffbbb2905-570eadd1-6b5c-46af-a3a9-bddfbd01c242-000000@eu-west-1.amazonses.com>

Do not call prepare_packed_git for every refs. In fetch-pack, git list ups entries in .git/objects/pack directory for each refs. Such behavior makes git fetch-pack slow for the repository having the large number of refs, especially for windows.

For chromium repository, having more than 300000 remote refs, git fetch takes more than 3 minutes if fetch-pack runs on my windows workstation. This patch improves the time to around 17 seconds in the same machine.

Signed-off-by: Takuto Ikuta <tikuta@google.com>
---
 fetch-pack.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fetch-pack.c b/fetch-pack.c
index 008b25d3db087..0184584e80599 100644
--- a/fetch-pack.c
+++ b/fetch-pack.c
@@ -716,7 +716,7 @@ static int everything_local(struct fetch_pack_args *args,
 	for (ref = *refs; ref; ref = ref->next) {
 		struct object *o;
 
-		if (!has_object_file(&ref->old_oid))
+		if (!has_object_file_with_flags(&ref->old_oid, OBJECT_INFO_QUICK))
 			continue;
 
 		o = parse_object(&ref->old_oid);

--
https://github.com/git/git/pull/437
Next: Junio C Hamano
Message 1 of 12 in “Use OBJECT_INFO_QUICK to speedup git fetch-pack”
  1. Use OBJECT_INFO_QUICK to speedup git fetch-packTakuto Ikuta, Nov 27, 2017
  2. Junio C HamanoNov 27, 2017
  3. Jeff KingNov 27, 2017
  4. Junio C HamanoNov 27, 2017
  5. Takuto IkutaNov 27, 2017
  6. Johannes SchindelinNov 27, 2017
  7. Junio C HamanoNov 27, 2017
  8. Johannes SchindelinNov 28, 2017
  9. Takuto IkutaNov 28, 2017
  10. Johannes SchindelinNov 28, 2017
  11. Takuto IkutaNov 28, 2017
  12. Jeff KingNov 27, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.