public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Patrick Steinhardt <ps@pks•im>
To: Derrick Stolee <stolee@gmail•com>
Cc: git@vger•kernel.org
Subject: Re: [PATCH] ls-refs: reuse buffer when sending refs
Date: Wed, 25 Aug 2021 17:43:39 +0200	[thread overview]
Message-ID: <YSZlK2y74wmYQcSd@ncase> (raw)
In-Reply-To: <705fee2c-7711-ac99-f692-ab08cd7b4e26@gmail.com>

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

On Wed, Aug 25, 2021 at 10:50:30AM -0400, Derrick Stolee wrote:
> On 8/25/2021 9:49 AM, Patrick Steinhardt wrote:
> > Improve this by passing in a buffer via the `ls_refs_data` struct which
> > is then reused on each reference. In a repository with about 2.3M refs,
> > this speeds up local mirror fetches by about 2%:
> > 
> >     Benchmark #1: HEAD~: git-fetch
> >       Time (mean ± σ):     25.415 s ±  0.131 s    [User: 22.722 s, System: 4.740 s]
> >       Range (min … max):   25.240 s … 25.543 s    5 runs
> > 
> >     Benchmark #2: HEAD: git-fetch
> >       Time (mean ± σ):     24.922 s ±  0.110 s    [User: 22.404 s, System: 4.476 s]
> >       Range (min … max):   24.825 s … 25.081 s    5 runs
> > 
> >     Summary
> >       'HEAD: git-fetch' ran
> >         1.02 ± 0.01 times faster than 'HEAD~: git-fetch'
> > 
> > Signed-off-by: Patrick Steinhardt <ps@kps•im>
> > ---
> > 
> > Note that while this topic applies on top of "master", I've done the
> > benchmark on top of my other optimizations for fetches. It's cheating a
> > bit, but it's easier to see that the optimization does something when
> > the remaining constant part is lower.
> 
> I don't mind demonstrating an optimization using the other work.
> 
> Perhaps this would be better grouped with those other changes?
> I know that the text is independent and merges cleanly without it,
> but it can be helpful to think about the effort as one unified
> topic instead of juggling multiple, especially because I don't
> see the other one needing many revisions.

I don't know. I just happen to revisit this topic every few days, and
every time I stumble upon some more performance improvements. It would
feel wrong to shift the goalposts of the other series every time I find
something new, so I instead opt for separate patch series.

If this proves to be annoying for reviewers, then feel free to shout at
me and I'll change my approach.

Thanks for your review!

Patrick

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

  reply	other threads:[~2021-08-25 15:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-25 13:49 [PATCH] ls-refs: reuse buffer when sending refs Patrick Steinhardt
2021-08-25 14:10 ` Patrick Steinhardt
2021-08-25 14:50 ` Derrick Stolee
2021-08-25 15:43   ` Patrick Steinhardt [this message]
2021-08-25 17:23     ` 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=YSZlK2y74wmYQcSd@ncase \
    --to=ps@pks$(echo .)im \
    --cc=git@vger$(echo .)kernel.org \
    --cc=stolee@gmail$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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