Git development
 help / color / mirror / Atom feed
From: Sergey Vlasov <vsu@altlinux.ru>
To: Junio C Hamano <junkio@cox.net>
Cc: git@vger.kernel.org
Subject: [PATCH 8/8] fetch.c: Remove call to parse_object() from process()
Date: Wed, 21 Sep 2005 20:19:09 +0400 (MSD)	[thread overview]
Message-ID: <20050921161909.C39C5E2FFC7@center4.mivlgu.local> (raw)
In-Reply-To: <20050921161829.GA20944@master.mivlgu.local>

The call to parse_object() in process() is not actually needed - if
the object type is unknown, parse_object() will be called by loop();
if the type is known, the object will be parsed by the appropriate
process_*() function.

After this change blobs which exist locally are no longer parsed,
which gives about 2x CPU usage improvement; the downside is that there
will be no warnings for existing corrupted blobs, but detecting such
corruption is the job of git-fsck-objects, not the fetch programs.
Newly fetched objects are still checked for corruption in http-fetch.c
and ssh-fetch.c (local-fetch.c does not seem to do it, but the removed
parse_object() call would not be reached for new objects anyway).

---

 fetch.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

b8a4d51743787be17f9572dce2eb2f4040ac241b
diff --git a/fetch.c b/fetch.c
--- a/fetch.c
+++ b/fetch.c
@@ -134,7 +134,6 @@ static int process(struct object *obj)
 	obj->flags |= SEEN;
 
 	if (has_sha1_file(obj->sha1)) {
-		parse_object(obj->sha1);
 		/* We already have it, so we should scan it now. */
 		obj->flags |= TO_SCAN;
 	} else {

  parent reply	other threads:[~2005-09-21 16:19 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-21 16:18 [PATCH 0/8] fetch.c optimizations Sergey Vlasov
2005-09-21 16:18 ` [PATCH 1/8] fetch.c: Remove useless lookup_object_type() call in process() Sergey Vlasov
2005-09-21 19:45   ` Junio C Hamano
2005-09-22  8:50     ` Sergey Vlasov
2005-09-21 16:18 ` [PATCH 2/8] fetch.c: Make process() look at each object only once Sergey Vlasov
2005-09-21 16:18 ` [PATCH 3/8] fetch.c: Remove redundant SCANNED flag Sergey Vlasov
2005-09-21 16:19 ` [PATCH 4/8] fetch.c: Remove redundant TO_FETCH flag Sergey Vlasov
2005-09-21 16:19 ` [PATCH 5/8] fetch.c: Remove some duplicated code in process() Sergey Vlasov
2005-09-21 16:19 ` [PATCH 6/8] fetch.c: Remove redundant test of TO_SCAN " Sergey Vlasov
2005-09-21 16:19 ` [PATCH 7/8] fetch.c: Clean up object flag definitions Sergey Vlasov
2005-09-21 16:19 ` Sergey Vlasov [this message]
2005-09-21 21:03 ` [PATCH 0/8] fetch.c optimizations Daniel Barkalow

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=20050921161909.C39C5E2FFC7@center4.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