Subject: Re: [PATCH v3 1/4] connected: do not sort input revisions

From: Patrick Steinhardt <[email-masked]>
Date: Tue, 3 Aug 2021 10:50:09 +0200

On Mon, Aug 02, 2021 at 02:49:29PM +0200, Ævar Arnfjörð Bjarmason wrote:
> On Mon, Aug 02 2021, Patrick Steinhardt wrote:
[snip]
> > Introduce a new "--unsorted-input" flag to git-rev-list(1) which will
> > cause it to not sort the commits and adjust the connectivity check to
> > always pass the flag. This results in the following speedups, executed
> > in a clone of gitlab-org/gitlab [1]:
> >
> >     Benchmark #1: git rev-list  --objects --quiet --not --all --not $(cat newrev)
> >       Time (mean ± σ):      7.639 s ±  0.065 s    [User: 7.304 s, System: 0.335 s]
> >       Range (min … max):    7.543 s …  7.742 s    10 runs
> >
> >     Benchmark #2: git rev-list --unsorted-input --objects --quiet --not --all --not $newrev
> >       Time (mean ± σ):      4.995 s ±  0.044 s    [User: 4.657 s, System: 0.337 s]
> >       Range (min … max):    4.909 s …  5.048 s    10 runs
> >
> >     Summary
> >       'git rev-list --unsorted-input --objects --quiet --not --all --not $(cat newrev)' ran
> >         1.53 ± 0.02 times faster than 'git rev-list  --objects --quiet --not --all --not $newrev'
> 
> Just bikeshedding for a potential re-roll, perhaps --unordered-input, so
> that it matches/rhymes with the existing "git cat-file --unordered",
> which serves the same conceptual purpose (except this one's input, that
> one's output).

Yeah, I wasn't quite sure how to name it myself either. Internally, we
typically use "unsorted" instead of "unordered", and there's also the
preexisting "--no-walk=(sorted|unsorted)" flag for git-rev-list(1). With
the latter in mind, I think that "unsorted" fits a bit better given that
we already use it in the same command, but I don't particularly mind.

For now, I'll keep "--unsorted-input", but please feel free to give me
another shout if you disagree with my reasoning.

Patrick