1
0
mirror of https://github.com/git/git.git synced 2024-10-21 05:48:38 +02:00
git/builtin
Jonathan Tan f08cbf60fe index-pack: make quantum of work smaller
Currently, when index-pack resolves deltas, it does not split up delta
trees into threads: each delta base root (an object that is not a
REF_DELTA or OFS_DELTA) can go into its own thread, but all deltas on
that root (direct or indirect) are processed in the same thread.

This is a problem when a repository contains a large text file (thus,
delta-able) that is modified many times - delta resolution time during
fetching is dominated by processing the deltas corresponding to that
text file.

This patch contains a solution to that. When cloning using

  git -c core.deltabasecachelimit=1g clone \
    https://fuchsia.googlesource.com/third_party/vulkan-cts

on my laptop, clone time improved from 3m2s to 2m5s (using 3 threads,
which is the default).

The solution is to have a global work stack. This stack contains delta
bases (objects, whether appearing directly in the packfile or generated
by delta resolution, that themselves have delta children) that need to
be processed; whenever a thread needs work, it peeks at the top of the
stack and processes its next unprocessed child. If a thread finds the
stack empty, it will look for more delta base roots to push on the stack
instead.

The main weakness of having a global work stack is that more time is
spent in the mutex, but profiling has shown that most time is spent in
the resolution of the deltas themselves, so this shouldn't be an issue
in practice. In any case, experimentation (as described in the clone
command above) shows that this patch is a net improvement.

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-09-08 15:52:17 -07:00
..
add.c strvec: rename struct fields 2020-07-30 19:18:06 -07:00
am.c strvec: rename struct fields 2020-07-30 19:18:06 -07:00
annotate.c strvec: rename struct fields 2020-07-30 19:18:06 -07:00
apply.c
archive.c
bisect--helper.c Merge branch 'al/bisect-first-parent' 2020-08-17 17:02:45 -07:00
blame.c messages: avoid SHA-1 in end-user facing messages 2020-08-14 09:33:37 -07:00
branch.c
bundle.c Merge branch 'bc/sha-256-part-3' 2020-08-11 18:04:11 -07:00
cat-file.c
check-attr.c
check-ignore.c
check-mailmap.c
check-ref-format.c
checkout-index.c
checkout.c checkout: support renormalization with checkout -m <paths> 2020-08-03 11:48:15 -07:00
clean.c
clone.c Merge branch 'jk/strvec' 2020-08-10 10:23:57 -07:00
column.c
commit-graph.c Merge branch 'ds/commit-graph-bloom-updates' into master 2020-07-30 13:20:31 -07:00
commit-tree.c
commit.c strvec: rename struct fields 2020-07-30 19:18:06 -07:00
config.c
count-objects.c
credential.c
describe.c strvec: rename struct fields 2020-07-30 19:18:06 -07:00
diff-files.c
diff-index.c
diff-tree.c
diff.c
difftool.c strvec: rename struct fields 2020-07-30 19:18:06 -07:00
env--helper.c
fast-export.c
fetch-pack.c
fetch.c strvec: rename struct fields 2020-07-30 19:18:06 -07:00
fmt-merge-msg.c
for-each-ref.c
fsck.c fsck: do not lazy fetch known non-promisor object 2020-08-06 13:01:03 -07:00
gc.c strvec: rename struct fields 2020-07-30 19:18:06 -07:00
get-tar-commit-id.c
grep.c Merge branch 'jk/strvec' 2020-08-10 10:23:57 -07:00
hash-object.c
help.c help: drop usage of 'common' and 'useful' for guides 2020-08-04 18:34:01 -07:00
index-pack.c index-pack: make quantum of work smaller 2020-09-08 15:52:17 -07:00
init-db.c repository: enable SHA-256 support by default 2020-07-30 09:16:49 -07:00
interpret-trailers.c
log.c Merge branch 'jk/log-fp-implies-m' 2020-08-17 17:02:49 -07:00
ls-files.c
ls-remote.c
ls-tree.c
mailinfo.c
mailsplit.c
merge-base.c
merge-file.c
merge-index.c
merge-ours.c
merge-recursive.c
merge-tree.c
merge.c merge: make merge.renormalize work for all uses of merge machinery 2020-08-03 11:48:15 -07:00
mktag.c
mktree.c
multi-pack-index.c
mv.c
name-rev.c messages: avoid SHA-1 in end-user facing messages 2020-08-14 09:33:37 -07:00
notes.c
pack-objects.c Merge branch 'jc/object-names-are-not-sha-1' 2020-08-19 16:14:52 -07:00
pack-redundant.c
pack-refs.c
patch-id.c
prune-packed.c
prune.c
pull.c strvec: rename struct fields 2020-07-30 19:18:06 -07:00
push.c
range-diff.c
read-tree.c
rebase.c strvec: rename struct fields 2020-07-30 19:18:06 -07:00
receive-pack.c strvec: rename struct fields 2020-07-30 19:18:06 -07:00
reflog.c
remote-ext.c
remote-fd.c
remote.c strvec: rename struct fields 2020-07-30 19:18:06 -07:00
repack.c
replace.c strvec: rename struct fields 2020-07-30 19:18:06 -07:00
rerere.c
reset.c
rev-list.c bisect: combine args passed to find_bisection() 2020-08-07 15:13:03 -07:00
rev-parse.c
revert.c
rm.c
send-pack.c
shortlog.c
show-branch.c strvec: rename struct fields 2020-07-30 19:18:06 -07:00
show-index.c
show-ref.c
sparse-checkout.c
stash.c strvec: rename struct fields 2020-07-30 19:18:06 -07:00
stripspace.c
submodule--helper.c strvec: rename struct fields 2020-07-30 19:18:06 -07:00
symbolic-ref.c
tag.c
unpack-file.c
unpack-objects.c
update-index.c
update-ref.c
update-server-info.c
upload-archive.c strvec: rename struct fields 2020-07-30 19:18:06 -07:00
upload-pack.c
var.c
verify-commit.c
verify-pack.c Merge branch 'bc/sha-256-part-3' 2020-08-11 18:04:11 -07:00
verify-tag.c
worktree.c strvec: rename struct fields 2020-07-30 19:18:06 -07:00
write-tree.c