git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Elijah Newren <newren@gmail.com>
To: Derrick Stolee <stolee@gmail.com>
Cc: Derrick Stolee <dstolee@microsoft.com>,
	Git Mailing List <git@vger.kernel.org>
Subject: Re: commit-graph is cool (overcoming add_missing_tags() perf issues)
Date: Tue, 30 Oct 2018 22:45:13 -0700	[thread overview]
Message-ID: <CABPp-BHPZD2zRkrbAFOEp4KAT+fAvO4KzFrCsk_Pyy5V65t=ig@mail.gmail.com> (raw)
In-Reply-To: <302a9351-6133-f562-8c5a-d688d5cc3c88@gmail.com>

On Tue, Oct 30, 2018 at 7:22 AM Derrick Stolee <stolee@gmail.com> wrote:
>
> On 10/17/2018 2:00 PM, Elijah Newren wrote:
> > Hi,
> >
> > Just wanted to give a shout-out for the commit-graph work and how
> > impressive it is.  I had an internal report from a user that git
> > pushes containing only one new tiny commit were taking over a minute
> > (in a moderate size repo with good network connectivity). After
> > digging for a while, I noticed three unusual things about the repo[1]:
> >    * he had push.followTags set to true
> >    * upstream repo had about 20k tags (despite only 55k commits)
> >    * his repo had an additional 2.5k tags, but none of these were in
> >      the history of the branches he was pushing and thus would not be
> >      included in any pushes.
> >
> > Digging in, almost all the time was CPU-bound and spent in
> > add_missing_tags()[2].  If I'm reading the code correctly, it appears
> > that function loops over each tag, calling in_merge_bases_many() once
> > per tag.  Thus, for his case, we were potentially walking all of
> > history of the main branch 2.5k times.  That seemed rather suboptimal.
>
> Elijah,
>
> Do you still have this repo around? Could you by chance test the
> performance with the new algorithm for add_missing_tags() in [1]?
> Specifically, please test it without a commit-graph file, since your
> data shape already makes use of generation numbers pretty well.
>
> Thanks,
> -Stolee

I nuked it, but turns out I had a backup that I found after digging
around for a bit.  I'll post a comment on the series with the results.

By the way, I've been running pu for about a week with this tweak:

diff --git a/revision.c b/revision.c
index b5108b75ab..d20c687e71 100644
--- a/revision.c
+++ b/revision.c
@@ -1457,6 +1457,7 @@ void repo_init_revisions(struct repository *r,
        revs->pruning.change = file_change;
        revs->pruning.change_fn_data = revs;
        revs->sort_order = REV_SORT_IN_GRAPH_ORDER;
+       revs->topo_order = 1;
        revs->dense = 1;
        revs->prefix = prefix;
        revs->max_age = -1;

Only ran into one small problem once, and it wasn't commit-graph
related; rather it was related to my above patch and needing to not
have topo_order be set.  (I just bailed and used my older
system-installed git from /usr/bin/ in that one case.)  So, I think
the commit-graph stuff is looking pretty good, and I find the recent
thread on further improvements with corrected commit date (among other
possibilities) very intriguing...even if I haven't had much time to
comment or test recently.

  reply	other threads:[~2018-10-31  5:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-17 18:00 commit-graph is cool (overcoming add_missing_tags() perf issues) Elijah Newren
2018-10-17 18:19 ` Derrick Stolee
2018-10-17 18:31 ` Jeff King
2018-10-30 14:22 ` Derrick Stolee
2018-10-31  5:45   ` Elijah Newren [this message]
2018-10-30 16:22 ` Ævar Arnfjörð Bjarmason
2018-10-31  5:46   ` Elijah Newren

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='CABPp-BHPZD2zRkrbAFOEp4KAT+fAvO4KzFrCsk_Pyy5V65t=ig@mail.gmail.com' \
    --to=newren@gmail.com \
    --cc=dstolee@microsoft.com \
    --cc=git@vger.kernel.org \
    --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).