Re: [PATCH 0/3] Make add_missing_tags() linear
- Date: Fri, 2 Nov 2018 11:38:55 -0400
- From: Derrick Stolee <stolee@xxxxxxxxx>
- Subject: Re: [PATCH 0/3] Make add_missing_tags() linear
On 11/2/2018 10:58 AM, Elijah Newren wrote:
On Thu, Nov 1, 2018 at 12:02 PM Derrick Stolee <stolee@xxxxxxxxx> wrote:
On 11/1/2018 2:57 PM, Elijah Newren wrote:
On Thu, Nov 1, 2018 at 5:32 AM Derrick Stolee <stolee@xxxxxxxxx> wrote:
No rush. I'd just like to understand how removing the commit-graph file
can make the new algorithm faster. Putting a similar count in the old
algorithm would involve giving a count for every call to
in_merge_bases_many(), which would be very noisy.
$ time git push --dry-run --follow-tags /home/newren/repo-mirror
* [new branch] test5 -> test5
Is the above test with or without the commit-graph file? Can you run it
in the other mode, too? I'd like to see if the "count" value changes
when the only difference is the presence of a commit-graph file.
I apologize for providing misleading information earlier; this was an
apples to oranges comparison. Here's what I did:
<build a version of git with your fixes>
git clone coworker.bundle coworker-repo
time git push --dry-run --follow-tags /home/newren/repo-mirror
git config core.commitgraph true
git config gc.writecommitgraph true
time git push --dry-run --follow-tags /home/newren/nucleus-mirror
I figured I had just done a fresh clone, so surely the gc wouldn't do
anything other than write the .git/objects/info/commit-graph file.
However, the original bundle contained many references outside of
refs/heads/ and refs/tags/:
$ git bundle list-heads ../coworker.bundle | grep -v -e refs/heads/ -e
refs/tags/ -e HEAD | wc -l
These other refs apparently referred to objects not otherwise
referenced in refs/heads/ and refs/tags/, and caused the gc to explode
lots of loose objects:
$ git count-objects -v
The slowdown with commit-graph was entirely due to there being lots of
loose objects (147K of them). If I add a git-prune before doing the
timing with commit-graph, then the timing with commit-graph is faster
than the run without a commit-graph.
Sorry for the wild goose chase.
And thanks for the fixes; get_reachable_subset() makes things much
faster even without a commit-graph, and the commit-graph just improves
it more. :-)
Thanks for double-checking! It's good to have confidence that this is a good
algorithm to use.