git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2 1/2] fetch-pack: use commit-graph when computing cutoff

From
Patrick Steinhardt <ps@pks.im>
Date
Feb 10, 2022, 11:43 UTC
Message-ID
<YgT6WWsb1QaKIbsu@ncase>
In-Reply-To
<CAP8UFD2H-WfKRpwY7jNf=Dc0g1_Kc1adY4-c2OfkoMg3wHJCrA@mail.gmail.com>
On Wed, Feb 09, 2022 at 07:01:54PM +0100, Christian Couder wrote:
Show 19 quoted lines
> On Mon, Feb 7, 2022 at 7:03 AM Patrick Steinhardt <ps@pks.im> wrote:
> 
> > Benchmarks in a repository with about 2,1 million refs and an up-to-date
> > commit-graph show a 20% speedup when mirror-fetching:
> >
> >     Benchmark 1: git fetch --atomic +refs/*:refs/* (v2.35.0)
> >       Time (mean ± σ):     75.264 s ±  1.115 s    [User: 68.199 s, System: 10.094 s]
> >       Range (min … max):   74.145 s … 76.862 s    5 runs
> >
> >     Benchmark 2: git fetch --atomic +refs/*:refs/* (HEAD)
> >       Time (mean ± σ):     62.350 s ±  0.854 s    [User: 55.412 s, System: 9.976 s]
> >       Range (min … max):   61.224 s … 63.216 s    5 runs
> >
> >     Summary
> >       'git fetch --atomic +refs/*:refs/* (HEAD)' ran
> >         1.21 ± 0.02 times faster than 'git fetch --atomic +refs/*:refs/* (v2.35.0)'
> 
> The commit message and code make sense to me, but I wonder if there is
> a reason why --atomic is used when fetching.

The repository that I was mirror-fetching into needs to update a big bunch of references, and doing that via `--atomic` is more efficient than doing it without, and this shows in the benchmark. I did another benchmarking run without `--atomic`, and it is indeed about 30 seconds slower for both cases. But interestingly the relative performance improvement is still roughly the same:

    Benchmark 1: git fetch +refs/*:refs/* (v2.35.0)
      Time (mean ± σ):     115.587 s ±  2.009 s    [User: 109.874 s, System: 11.305 s]
      Range (min … max):   113.584 s … 118.820 s    5 runs
    Benchmark 2: git fetch +refs/*:refs/* (pks-fetch-pack-optim-v1~)
      Time (mean ± σ):     96.859 s ±  0.624 s    [User: 91.948 s, System: 10.980 s]
      Range (min … max):   96.180 s … 97.875 s    5 runs
    Summary
      'git fetch +refs/*:refs/* (pks-fetch-pack-optim-v1~)' ran
        1.19 ± 0.02 times faster than 'git fetch +refs/*:refs/* (v2.35.0)'

I'll update the commit message to just use this new benchmark so that the `--atomic` flag doesn't cause any questions.

Patrick
Previous: Christian CouderNext: Patrick Steinhardt
Message 9 of 16 in “fetch: speed up mirror-fetches with many refs”
  1. 0/2 fetch: speed up mirror-fetches with many refsPatrick Steinhardt, Jan 28, 2022
  2. 1/2 fetch-pack: use commit-graph when computing cutoffPatrick Steinhardt, Jan 28, 2022
  3. Taylor BlauJan 31, 2022
  4. Patrick SteinhardtFeb 2, 2022
  5. 2/2 fetch: skip computing output width when not printing anythingPatrick Steinhardt, Jan 28, 2022
  6. 0/2 fetch: speed up mirror-fetches with many refsPatrick Steinhardt, Feb 2, 2022
  7. 1/2 fetch-pack: use commit-graph when computing cutoffPatrick Steinhardt, Feb 2, 2022
  8. Christian CouderFeb 9, 2022
  9. Patrick SteinhardtFeb 10, 2022
  10. 2/2 fetch: skip computing output width when not printing anythingPatrick Steinhardt, Feb 2, 2022
  11. Christian CouderFeb 9, 2022
  12. Patrick SteinhardtFeb 10, 2022
  13. 0/2 fetch: speed up mirror-fetches with many refsPatrick Steinhardt, Feb 10, 2022
  14. 1/2 fetch-pack: use commit-graph when computing cutoffPatrick Steinhardt, Feb 10, 2022
  15. 2/2 fetch: skip computing output width when not printing anythingPatrick Steinhardt, Feb 10, 2022
  16. Junio C HamanoFeb 10, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.