git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Christian Couder <christian.couder@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: "SZEDER Gábor" <szeder.dev@gmail.com>, git <git@vger.kernel.org>
Subject: Re: [PATCH] bisect: loosen halfway() check for a large number of commits
Date: Sat, 24 Oct 2020 09:41:27 +0200	[thread overview]
Message-ID: <CAP8UFD30NZREjE+_WHKyAhkHAi1TjHQo7iXd9xkvHj9stjT=9A@mail.gmail.com> (raw)
In-Reply-To: <xmqqv9f2mb61.fsf@gitster.c.googlers.com>

On Thu, Oct 22, 2020 at 8:20 PM Junio C Hamano <gitster@pobox.com> wrote:
>
> SZEDER Gábor <szeder.dev@gmail.com> writes:
>
> > However, when we have thousands of commits it's not all that important
> > to find the _exact_ halfway point, a few commits more or less doesn't
> > make any real difference for the bisection.
>
> Cute idea.

I like the idea too.

> > So I ran some tests to see how often that happens: picked random good
> > and bad starting revisions at least 50k commits apart and a random
> > first bad commit in between in git.git, and used 'git bisect run git
> > merge-base --is-ancestor HEAD $first_bad_commit' to check the number
> > of necessary bisection steps.  After repeating all this 1000 times
> > both with and without this patch I found that:
> >
> >   - 146 cases needed one more bisection step than before, 149 cases
> >     needed one less step, while in the remaining 705 cases the number
> >     of steps didn't change.  So the number of bisection steps does
> >     indeed change in a non-negligible number of cases, but it seems
> >     that the average number of steps doesn't change in the long run.
>
> It somehow is a bit surprising that there are cases that need fewer
> steps, but I guess that is how rounding-error cuts both ways?

When there are 50k commits span between the initial good and bad, I
don't expect to see any statistically significant result by trying it
1k times only. My guess is that you might start seeing something
significant only when the number of tries is a multiple of the span
between the initial good and bad.

There is some cost on average even if it's small (and gets smaller
when the span increases) of not using the best halfway commit, so the
overall gain depends on how long it takes (and possibly how much it
costs) to run the test script (or maybe to manually test).
Unfortunately without any hint from the user or without recording how
long the test script lasts (which doesn't cover manual testing) we
cannot know this cost of testing which could change a lot between use
cases.

> Mildly (only because such a bisection session over a long span is
> rarer) excited to see this RFC completed ;-)

In projects like the Linux kernel where there are around 10k commits
between 2 feature releases, such bisections over a long span might
actually happen quite often.

  reply	other threads:[~2020-10-24  7:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-22 10:38 [PATCH] bisect: loosen halfway() check for a large number of commits SZEDER Gábor
2020-10-22 10:40 ` SZEDER Gábor
2020-10-22 17:18 ` Junio C Hamano
2020-10-24  7:41   ` Christian Couder [this message]
2020-10-25 18:01     ` SZEDER Gábor
2020-11-12 16:19 ` [PATCH v2] " SZEDER Gábor
2020-11-12 18: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

  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='CAP8UFD30NZREjE+_WHKyAhkHAi1TjHQo7iXd9xkvHj9stjT=9A@mail.gmail.com' \
    --to=christian.couder@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=szeder.dev@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).