From: Sergey Vlasov <vsu@altlinux.ru>
To: git@vger.kernel.org
Cc: Junio C Hamano <junkio@cox.net>
Subject: [PATCH 1/4] Do not try to process objects more than once during fetch
Date: Wed, 14 Sep 2005 16:42:55 +0400 [thread overview]
Message-ID: <20050914124255.GD24405@master.mivlgu.local> (raw)
In-Reply-To: <20050914124206.GC24405@master.mivlgu.local>
fetch.c:process() is often called more than once for the same object;
e.g., for unpacked git repository with 7313 objects there are 320997
calls to process() for objects which were already seen (and 7528 of
those calls are for tree objects, which is a real problem because of
recursive processing).
---
fetch.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
f8285569e916a21c28379b55415165a89794272a
diff --git a/fetch.c b/fetch.c
--- a/fetch.c
+++ b/fetch.c
@@ -7,6 +7,8 @@
#include "blob.h"
#include "refs.h"
+#define SEEN (1u << 0)
+
const char *write_ref = NULL;
const unsigned char *current_ref = NULL;
@@ -126,6 +128,12 @@ static int process_object(struct object
static int process(unsigned char *sha1, const char *type)
{
struct object *obj = lookup_object_type(sha1, type);
+
+ /* Do not try to process objects more than once */
+ if (obj->flags & SEEN)
+ return 0;
+ obj->flags |= SEEN;
+
if (has_sha1_file(sha1)) {
parse_object(sha1);
/* We already have it, so we should scan it now. */
next prev parent reply other threads:[~2005-09-14 12:43 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-09-14 12:42 [PATCH 0/4] Recovery after interrupted HTTP(s) fetch Sergey Vlasov
2005-09-14 12:42 ` Sergey Vlasov [this message]
2005-09-14 12:45 ` [PATCH 2/4] git-*-fetch: Gracefully recover from retrieval failure Sergey Vlasov
2005-09-14 12:47 ` [PATCH 3/4] git-fetch: Add --recover option Sergey Vlasov
2005-09-14 12:48 ` [PATCH 4/4] Document git-fetch options Sergey Vlasov
2005-09-14 18:16 ` [PATCH 0/4] Recovery after interrupted HTTP(s) fetch Junio C Hamano
2005-09-14 20:27 ` Linus Torvalds
2005-09-14 20:48 ` Junio C Hamano
2005-09-14 20:55 ` Daniel Barkalow
2005-09-14 21:15 ` Linus Torvalds
2005-09-14 21:24 ` Daniel Barkalow
2005-09-14 21:53 ` Junio C Hamano
2005-09-15 10:35 ` Matthias Urlichs
2005-09-15 19:02 ` Daniel Barkalow
2005-09-15 19:31 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20050914124255.GD24405@master.mivlgu.local \
--to=vsu@altlinux.ru \
--cc=git@vger.kernel.org \
--cc=junkio@cox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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 NNTP newsgroup(s).