git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Abhishek Kumar <abhishekkumar8222@gmail.com>
To: Derrick Stolee via GitGitGadget <gitgitgadget@gmail.com>
Cc: dstolee@microsoft.com, git@vger.kernel.org, szeder.dev@gmail.com
Subject: Re: [PATCH 0/2] Accelerate "git merge-base --is-ancestor"
Date: Fri, 19 Jun 2020 11:40:13 +0530	[thread overview]
Message-ID: <20200619061013.GA10213@Abhishek-Arch> (raw)
In-Reply-To: <pull.664.git.1592414670.gitgitgadget@gmail.com>

On Wed, Jun 17, 2020 at 05:24:27PM +0000, Derrick Stolee via GitGitGadget wrote:
> It was recently [1] reported (and not-so-recently [2] reported) that "git
> merge-base --is-ancestor" can be pretty slow. In fact, it is regularly
> slower than "git branch --contains" or "git tag --contains", which are
> answering a "harder" query.
> 
> [1] https://lore.kernel.org/git/20200607195347.GA8232@szeder.dev/
> 
> [2] https://lore.kernel.org/git/87608bawoa.fsf@evledraar.gmail.com/
> 
> The root cause is that the in_merge_base() implementation is skipping the
> fast can_all_from_reach() implementation and using paint_down_to_common()
> instead. Note that these are equivalent: a commit A is in the set of
> merge-bases between A and B if and only if B can reach A.
> 
> This fixes the issue, and makes the performance degradation reported by
> Szeder a non-issue.
> 
> Thanks, -Stolee
> 
> Derrick Stolee (2):
>   commit-reach: create repo_is_descendant_of()
>   commit-reach: use fast logic in repo_in_merge_base
> 
>  commit-reach.c | 21 ++++++++++++++++++---
>  1 file changed, 18 insertions(+), 3 deletions(-)
> 
> 
> base-commit: b3d7a52fac39193503a0b6728771d1bf6a161464
> Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-664%2Fderrickstolee%2Fmerge-base-is-ancestor-v1
> Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-664/derrickstolee/merge-base-is-ancestor-v1
> Pull-Request: https://github.com/gitgitgadget/git/pull/664
> -- 
> gitgitgadget

Wow! Thanks for investigating through the issue and following up. The
performance numbers speak for themselves.

By applying this series on the commit-slab patch series, both are now
just as fast (master: 0.048s, commit-slab: 0.050s). 

Regards
Abhishek

      parent reply	other threads:[~2020-06-19  6:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-17 17:24 [PATCH 0/2] Accelerate "git merge-base --is-ancestor" Derrick Stolee via GitGitGadget
2020-06-17 17:24 ` [PATCH 1/2] commit-reach: create repo_is_descendant_of() Derrick Stolee via GitGitGadget
2020-06-29 13:40   ` Taylor Blau
2020-06-30  1:45     ` Derrick Stolee
2020-06-17 17:24 ` [PATCH 2/2] commit-reach: use fast logic in repo_in_merge_base Derrick Stolee via GitGitGadget
2020-06-17 20:46 ` [PATCH 0/2] Accelerate "git merge-base --is-ancestor" Junio C Hamano
2020-06-18  1:37   ` Derrick Stolee
2020-06-19  6:10 ` Abhishek Kumar [this message]

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=20200619061013.GA10213@Abhishek-Arch \
    --to=abhishekkumar8222@gmail.com \
    --cc=dstolee@microsoft.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=pull.664.git.1592414670.gitgitgadget@gmail.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).