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

Re: [PATCH v2 2/2] fetch: skip computing output width when not printing anything

From
Christian Couder <christian.couder@gmail.com>
Date
Feb 9, 2022, 18:10 UTC
Message-ID
<CAP8UFD0r2ZnGCAjkQcLfEZCvxHVFGSWeAC7vSat7V7-=rhiGeQ@mail.gmail.com>
In-Reply-To
<4b9bbcf7958da6db2be771f910974a6bffb2d94a.1643806143.git.ps@pks.im>
On Wed, Feb 2, 2022 at 5:13 PM Patrick Steinhardt <ps@pks.im> wrote:
> Skip computing the summary width when the user asked for us to be quiet.

There is a --quiet option for git fetch, so here we can expect that it will be used to test this speedup...

Show 14 quoted lines
> This gives us a small speedup of nearly 10% when doing a dry-run
> mirror-fetch in a repository with thousands of references being updated:
>
>     Benchmark 1: git fetch --prune --dry-run +refs/*:refs/* (HEAD~)
>       Time (mean ± σ):     34.048 s ±  0.233 s    [User: 30.739 s, System: 4.640 s]
>       Range (min … max):   33.785 s … 34.296 s    5 runs
>
>     Benchmark 2: git fetch --prune --dry-run +refs/*:refs/* (HEAD)
>       Time (mean ± σ):     30.768 s ±  0.287 s    [User: 27.534 s, System: 4.565 s]
>       Range (min … max):   30.432 s … 31.181 s    5 runs
>
>     Summary
>       'git fetch --prune --dry-run +refs/*:refs/* (HEAD)' ran
>         1.11 ± 0.01 times faster than 'git fetch --prune --dry-run +refs/*:refs/* (HEAD~)'

...but --prune and --dry-run are used for testing. It would be nice if this discrepancy was explained a bit.

Otherwise the commit message and code look good to me.
Previous: Patrick SteinhardtNext: Patrick Steinhardt
Message 11 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.