Skip to content

Commit d225ae5

Browse files
committed
Merge branch 'np/delta'
* np/delta: builtin-pack-objects.c: avoid bogus gcc warnings threaded delta search: proper locking for cache accounting threaded delta search: add pack.threads config variable fix threaded delta search locking threaded delta search: specify number of threads at run time threaded delta search: better chunck split point threaded delta search: refine work allocation basic threaded delta search rearrange delta search progress reporting localize window memory usage accounting straighten the list of objects to deltify
2 parents 357c5e0 + e1ef867 commit d225ae5

File tree

4 files changed

+256
-59
lines changed

4 files changed

+256
-59
lines changed

Documentation/config.txt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -630,9 +630,17 @@ pack.deltaCacheSize::
630630
A value of 0 means no limit. Defaults to 0.
631631

632632
pack.deltaCacheLimit::
633-
The maxium size of a delta, that is cached in
633+
The maximum size of a delta, that is cached in
634634
gitlink:git-pack-objects[1]. Defaults to 1000.
635635

636+
pack.threads::
637+
Specifies the number of threads to spawn when searching for best
638+
delta matches. This requires that gitlink:git-pack-objects[1]
639+
be compiled with pthreads otherwise this option is ignored with a
640+
warning. This is meant to reduce packing time on multiprocessor
641+
machines. The required amount of memory for the delta search window
642+
is however multiplied by the number of threads.
643+
636644
pull.octopus::
637645
The default merge strategy to use when pulling multiple branches
638646
at once.

Documentation/git-pack-objects.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,14 @@ base-name::
169169
length, this option typically shrinks the resulting
170170
packfile by 3-5 per-cent.
171171

172+
--threads=<n>::
173+
Specifies the number of threads to spawn when searching for best
174+
delta matches. This requires that pack-objects be compiled with
175+
pthreads otherwise this option is ignored with a warning.
176+
This is meant to reduce packing time on multiprocessor machines.
177+
The required amount of memory for the delta search window is
178+
however multiplied by the number of threads.
179+
172180
--index-version=<version>[,<offset>]::
173181
This is intended to be used by the test suite only. It allows
174182
to force the version for the generated pack index, and to force

Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,9 @@ all::
124124
# If not set it defaults to the bare 'wish'. If it is set to the empty
125125
# string then NO_TCLTK will be forced (this is used by configure script).
126126
#
127+
# Define THREADED_DELTA_SEARCH if you have pthreads and wish to exploit
128+
# parallel delta searching when packing objects.
129+
#
127130

128131
GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE
129132
@$(SHELL_PATH) ./GIT-VERSION-GEN
@@ -675,6 +678,11 @@ ifdef NO_MEMMEM
675678
COMPAT_OBJS += compat/memmem.o
676679
endif
677680

681+
ifdef THREADED_DELTA_SEARCH
682+
BASIC_CFLAGS += -DTHREADED_DELTA_SEARCH
683+
EXTLIBS += -lpthread
684+
endif
685+
678686
ifeq ($(TCLTK_PATH),)
679687
NO_TCLTK=NoThanks
680688
endif

0 commit comments

Comments
 (0)