git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Patrick Steinhardt <ps@pks.im>
To: Christian Couder <christian.couder@gmail.com>
Cc: git <git@vger.kernel.org>, Taylor Blau <me@ttaylorr.com>,
	Derrick Stolee <stolee@gmail.com>
Subject: Re: [PATCH v2 2/2] fetch: skip computing output width when not printing anything
Date: Thu, 10 Feb 2022 13:23:36 +0100	[thread overview]
Message-ID: <YgUDyLhO7UykfbF/@ncase> (raw)
In-Reply-To: <CAP8UFD0r2ZnGCAjkQcLfEZCvxHVFGSWeAC7vSat7V7-=rhiGeQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2177 bytes --]

On Wed, Feb 09, 2022 at 07:10:38PM +0100, Christian Couder wrote:
> On Wed, Feb 2, 2022 at 5:13 PM Patrick Steinhardt <ps@pks.im> wrote:
> 
> > Skip computing the summary width when the user asked for us to be quiet.
> 
> There is a --quiet option for git fetch, so here we can expect that it
> will be used to test this speedup...
> 
> > This gives us a small speedup of nearly 10% when doing a dry-run
> > mirror-fetch in a repository with thousands of references being updated:
> >
> >     Benchmark 1: git fetch --prune --dry-run +refs/*:refs/* (HEAD~)
> >       Time (mean ± σ):     34.048 s ±  0.233 s    [User: 30.739 s, System: 4.640 s]
> >       Range (min … max):   33.785 s … 34.296 s    5 runs
> >
> >     Benchmark 2: git fetch --prune --dry-run +refs/*:refs/* (HEAD)
> >       Time (mean ± σ):     30.768 s ±  0.287 s    [User: 27.534 s, System: 4.565 s]
> >       Range (min … max):   30.432 s … 31.181 s    5 runs
> >
> >     Summary
> >       'git fetch --prune --dry-run +refs/*:refs/* (HEAD)' ran
> >         1.11 ± 0.01 times faster than 'git fetch --prune --dry-run +refs/*:refs/* (HEAD~)'
> 
> ...but --prune and --dry-run are used for testing. It would be nice if
> this discrepancy was explained a bit.
> 
> Otherwise the commit message and code look good to me.

Yeah, I was hiding away the `--quiet` flag here by accident. I used
`--prune` and `--dry-run` to trigger more lines to be printed to console
and to not take into account the time it takes to update local refs and
fetch objects. But doing so without these flags also demonstrates what I
want to:

    Benchmark 1: git fetch --quiet +refs/*:refs/* (pks-fetch-pack-optim-v1~)
      Time (mean ± σ):     96.078 s ±  0.508 s    [User: 91.378 s, System: 10.870 s]
      Range (min … max):   95.449 s … 96.760 s    5 runs

    Benchmark 2: git fetch --quiet +refs/*:refs/* (pks-fetch-pack-optim-v1)
      Time (mean ± σ):     88.214 s ±  0.192 s    [User: 83.274 s, System: 10.978 s]
      Range (min … max):   87.998 s … 88.446 s    5 runs

So again, I'll update the commit message.

Thanks for your feedback!

Patrick

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2022-02-10 12:30 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-28 10:15 [PATCH 0/2] fetch: speed up mirror-fetches with many refs Patrick Steinhardt
2022-01-28 10:17 ` [PATCH 1/2] fetch-pack: use commit-graph when computing cutoff Patrick Steinhardt
2022-01-31 22:53   ` Taylor Blau
2022-02-02 12:46     ` Patrick Steinhardt
2022-01-28 10:19 ` [PATCH 2/2] fetch: skip computing output width when not printing anything Patrick Steinhardt
2022-02-02 12:51 ` [PATCH v2 0/2] fetch: speed up mirror-fetches with many refs Patrick Steinhardt
2022-02-02 12:51   ` [PATCH v2 1/2] fetch-pack: use commit-graph when computing cutoff Patrick Steinhardt
2022-02-09 18:01     ` Christian Couder
2022-02-10 11:43       ` Patrick Steinhardt
2022-02-02 12:51   ` [PATCH v2 2/2] fetch: skip computing output width when not printing anything Patrick Steinhardt
2022-02-09 18:10     ` Christian Couder
2022-02-10 12:23       ` Patrick Steinhardt [this message]
2022-02-10 12:28   ` [PATCH v3 0/2] fetch: speed up mirror-fetches with many refs Patrick Steinhardt
2022-02-10 12:28     ` [PATCH v3 1/2] fetch-pack: use commit-graph when computing cutoff Patrick Steinhardt
2022-02-10 12:28     ` [PATCH v3 2/2] fetch: skip computing output width when not printing anything Patrick Steinhardt
2022-02-10 18:04     ` [PATCH v3 0/2] fetch: speed up mirror-fetches with many refs 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

  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=YgUDyLhO7UykfbF/@ncase \
    --to=ps@pks.im \
    --cc=christian.couder@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=me@ttaylorr.com \
    --cc=stolee@gmail.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).