[PATCH 0/1] send-pack: set core.warnAmbiguousRefs=false
- Date: Tue, 06 Nov 2018 11:13:47 -0800 (PST)
- From: "Derrick Stolee via GitGitGadget" <gitgitgadget@xxxxxxxxx>
- Subject: [PATCH 0/1] send-pack: set core.warnAmbiguousRefs=false
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 for this is simple: set core.warnAmbiguousRefs to false for this
specific call of git pack-objects coming from git send-pack. We don't want
to default it to false for all calls to git pack-objects, as it is valid to
pass ref names instead of object ids. This helps regain these seconds during
In addition to this patch submission, we are looking into merging it into
our fork sooner .
Derrick Stolee (1):
send-pack: set core.warnAmbiguousRefs=false
send-pack.c | 2 ++
1 file changed, 2 insertions(+)
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-68/derrickstolee/send-pack-config-v1