git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] Use OBJECT_INFO_QUICK to speedup git fetch-pack
@ 2017-11-27  4:27 Takuto Ikuta
  2017-11-27  4:35 ` Junio C Hamano
  0 siblings, 1 reply; 12+ messages in thread
From: Takuto Ikuta @ 2017-11-27  4:27 UTC (permalink / raw)
  To: git

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

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2017-11-28 11:36 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-27  4:27 [PATCH] Use OBJECT_INFO_QUICK to speedup git fetch-pack Takuto Ikuta
2017-11-27  4:35 ` Junio C Hamano
2017-11-27  4:37   ` Jeff King
2017-11-27  4:53     ` Junio C Hamano
2017-11-27  5:01       ` Takuto Ikuta
2017-11-27 21:24         ` Johannes Schindelin
2017-11-27 23:52           ` Junio C Hamano
2017-11-28  0:33             ` Johannes Schindelin
2017-11-28  1:58               ` Takuto Ikuta
2017-11-28 11:27                 ` Johannes Schindelin
2017-11-28 11:35                   ` Takuto Ikuta
2017-11-27  5:04       ` Jeff King

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).