git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: 程洋 <chengyang@xiaomi.com>
Cc: "Taylor Blau" <me@ttaylorr.com>,
	"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
	"git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: [External Mail]Re: why git is so slow for a tiny git push?
Date: Wed, 24 Nov 2021 13:15:02 -0500	[thread overview]
Message-ID: <YZ6BJpAY4ZAWaqkr@coredump.intra.peff.net> (raw)
In-Reply-To: <56994f02ed4542b89cc6f9586d703e05@xiaomi.com>

On Tue, Nov 23, 2021 at 06:42:12AM +0000, 程洋 wrote:

> I got another problem here.
> When I tries to clone from remote server. It took me 25 seconds to enumerating objects. And then 1 second to `couting objects` by bitmap.
> I don't understand, why a fresh clone need `enumerating objects` ? Is `couting objects` enough for the server to determine what to send?

In older versions of Git, the "counting objects" progress meter used to
be the actual object graph traversal. That changed in v2.18 (via
5af050437a), but you may still seem some reference to "counting objects
is expensive".

These days that is called "enumerating objects", and "counting objects"
is just doing a quick-ish pass over that list to do some light analysis
(e.g., if we can reuse an on-disk delta). I'd expect "enumerating" to be
expensive in general, and "counting" to be quick in general.

The "enumerating" phase is where we determine what to send whether it's
for a clone or a fetch, and may involve opening up a bunch of trees to
walk the graph. It's what reachability bitmaps are supposed to make
faster. But if you have 300k refs, as you've mentioned, you almost
certainly don't have complete coverage of all of the ref tips, so we'll
have to fallback to doing at least a partial graph traversal.

Taylor (cc'd) has been looking at some tricks for speeding up cases like
this with a lot of refs. But I don't think there's anything to show
publicly yet.

-Peff

  reply	other threads:[~2021-11-24 18:15 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <c5a8595658d6416684c2bbd317494c49@xiaomi.com>
     [not found] ` <5a6f3e8f29f74c93bf3af5da636df973@xiaomi.com>
2021-10-09 18:05   ` why git is so slow for a tiny git push? 程洋
2021-10-11 16:53     ` Jeff King
2021-10-12  8:04       ` [External Mail]Re: " 程洋
2021-10-12  8:39         ` Jeff King
2021-10-12  9:08           ` 程洋
2021-10-12 21:39             ` Jeff King
2021-10-14  6:47               ` 程洋
2021-10-26 21:54                 ` Jeff King
2021-10-27  2:48                   ` 程洋
2021-10-12 10:06           ` Ævar Arnfjörð Bjarmason
2021-10-12 21:46             ` Jeff King
2021-11-23  6:42               ` 程洋
2021-11-24 18:15                 ` Jeff King [this message]
2021-11-25  2:53                   ` 程洋
2021-11-24  8:07               ` 程洋
2021-10-28 13:17     ` Han-Wen Nienhuys

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=YZ6BJpAY4ZAWaqkr@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=avarab@gmail.com \
    --cc=chengyang@xiaomi.com \
    --cc=git@vger.kernel.org \
    --cc=me@ttaylorr.com \
    /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).