git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Takuto Ikuta <tikuta@chromium.org>
Cc: git@vger.kernel.org
Subject: Re: [PATCH v3] fetch-pack.c: use oidset to check existence of loose object
Date: Fri, 09 Mar 2018 11:54:21 -0800	[thread overview]
Message-ID: <xmqq606558k2.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <20180309132655.224308-1-tikuta@chromium.org> (Takuto Ikuta's message of "Fri, 9 Mar 2018 22:26:55 +0900")

Takuto Ikuta <tikuta@chromium.org> writes:

> In repository having large number of remote refs, because to check

Isn't this "When fetching from a repository with large number of
refs,"?  The number of refs (whether it is local or remote-tracking)
the local side has has nothing to do with the issue you are
addressing, no?

> existence of each refs in local repository, 'git fetch' ends up doing a
> lot of lstat(2) calls to see if it exists in loose form, which makes it
> slow.

Other than that, the above description reads much better and makes
the result easier to understand.

> This patch enumerates loose objects in hashmap beforehand and uses it to
> check existence instead of using lstat(2) to improve performance of
> fetch-pack for repositories having large number of remote refs compared
> to the number of loose objects.

We'd rather write this paragraph as if giving an order to the
codebase "to be like so", e.g.

	Instead of making as many lstat(2) calls as the refs the
	remote side advertised to see if these objects exist in the
	loose form, first enumerate all the existing loose objects
	in hashmap beforehand and use it to check existence of
	them...

> I took time stat of `git fetch` disabling quickfetch, so that fetch-pack

I still do not know if a benchmark with quickfetch disabled gives
relevant numbers, for reasons I gave earlier.  The relative numbers
between Linux and MacBook look quite convincing, as they illustrate
differences of lstat(2) performance on these platforms.

>  	for (ref = *refs; ref; ref = ref->next) {
>  		struct object *o;
> +		unsigned int flags = OBJECT_INFO_QUICK;
>  
> -		if (!has_object_file_with_flags(&ref->old_oid,
> -						OBJECT_INFO_QUICK))
> -			continue;
> +		if (!oidset_contains(&loose_oid_set, &ref->old_oid)) {
> +			/* I know this does not exist in the loose form,
> +			 * so check if it exists in a non-loose form.
> +			 */

	/*
	 * Our multi-line comment looks like this,
	 * with opening slash-asterisk and closing
	 * asterisk-slash on their own lines.
	 */

Thanks.

  reply	other threads:[~2018-03-09 19:54 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-08 12:06 [PATCH] fetch-pack.c: use oidset to check existence of loose object Takuto Ikuta
2018-03-08 17:19 ` René Scharfe
2018-03-09 13:42   ` Takuto Ikuta
2018-03-08 18:42 ` Junio C Hamano
2018-03-09 13:11   ` [PATCH v2 0/1] " Takuto Ikuta
2018-03-09 13:11     ` [PATCH v2 1/1] " Takuto Ikuta
2018-03-09 13:26       ` [PATCH v3] " Takuto Ikuta
2018-03-09 19:54         ` Junio C Hamano [this message]
2018-03-10 13:19           ` Takuto Ikuta
2018-03-13 17:53             ` Junio C Hamano
2018-03-14  6:26               ` Takuto Ikuta
2018-03-10 12:34         ` [PATCH v4] " Takuto Ikuta
2018-03-10 12:46           ` [PATCH v5] " Takuto Ikuta
2018-03-13 19:04             ` Junio C Hamano
2018-03-14  6:05           ` [PATCH v6] " Takuto Ikuta
2018-03-14  6:32             ` [PATCH v7] " Takuto Ikuta
2018-03-09 14:12   ` [PATCH] " Takuto Ikuta
2018-03-09 18:00     ` Junio C Hamano
2018-03-09 19:41       ` Junio C Hamano
2018-03-13 15:30   ` [PATCH] sha1_file: restore OBJECT_INFO_QUICK functionality Jonathan Tan

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqq606558k2.fsf@gitster-ct.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=tikuta@chromium.org \
    /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.
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).