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

[PATCH v2 0/1] send-pack: set core.warnAmbiguousRefs=false

From
Derrick Stolee via GitGitGadget <gitgitgadget@gmail.com>
Date
Nov 6, 2018, 20:34 UTC
Message-ID
<pull.68.v2.git.gitgitgadget@gmail.com>
In-Reply-To
<pull.68.git.gitgitgadget@gmail.com>

I've been looking into the performance of git push for very large repos. Our users are reporting that 60-80% of git push time is spent during the "Enumerating objects" phase of git pack-objects.

A git push process runs several processes during its run, but one includes git send-pack which calls git pack-objects and passes the known have/wants into stdin using object ids. However, the default setting for core.warnAmbiguousRefs requires git pack-objects to check for ref names matching the ref_rev_parse_rules array in refs.c. This means that every object is triggering at least six "file exists?" queries.

When there are a lot of refs, this can add up significantly! My PerfView trace for a simple push measured 3 seconds spent checking these paths.

The fix is to set the global warn_on_object_refname_ambiguity to 0 for the section that is performing these object reads.

In addition to this patch submission, we are looking into merging it into our fork sooner [1].

[1] https://github.com/Microsoft/git/pull/67

Changes in V2: Instead of using the "-c" flag from send-pack, just set the global. I left the name of the cover letter the same to not confuse anyone viewing the message without threading.

Derrick Stolee (1):
  pack-objects: ignore ambiguous object warnings
 builtin/pack-objects.c | 6 ++++++
 1 file changed, 6 insertions(+)
base-commit: cae598d9980661a978e2df4fb338518f7bf09572
Published-As: https://github.com/gitgitgadget/git/releases/tags/pr-68%2Fderrickstolee%2Fsend-pack-config-v2
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-68/derrickstolee/send-pack-config-v2
Pull-Request: https://github.com/gitgitgadget/git/pull/68
Range-diff vs v1:
 1:  1ef2c51550 < -:  ---------- send-pack: set core.warnAmbiguousRefs=false
 -:  ---------- > 1:  002868ee6b pack-objects: ignore ambiguous object warnings
-- 
gitgitgadget
Previous: Derrick StoleeNext: Derrick Stolee via GitGitGadget
Message 7 of 12 in “send-pack: set core.warnAmbiguousRefs=false”
  1. 0/1 send-pack: set core.warnAmbiguousRefs=falseDerrick Stolee via GitGitGadget, Nov 6, 2018
  2. 1/1 send-pack: set core.warnAmbiguousRefs=falseDerrick Stolee via GitGitGadget, Nov 6, 2018
  3. Jeff KingNov 6, 2018
  4. Jeff KingNov 6, 2018
  5. Derrick StoleeNov 6, 2018
  6. Derrick StoleeNov 6, 2018
  7. 0/1 send-pack: set core.warnAmbiguousRefs=falseDerrick Stolee via GitGitGadget, Nov 6, 2018
  8. 1/1 pack-objects: ignore ambiguous object warningsDerrick Stolee via GitGitGadget, Nov 6, 2018
  9. Jeff KingNov 6, 2018
  10. Junio C HamanoNov 7, 2018
  11. Junio C HamanoNov 7, 2018
  12. Jeff KingNov 7, 2018

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.