Merge branch 'np/delta'
authorJunio C Hamano <gitster@pobox.com>
Sat, 15 Sep 2007 05:33:28 +0000 (22:33 -0700)
committerJunio C Hamano <gitster@pobox.com>
Sat, 15 Sep 2007 05:33:28 +0000 (22:33 -0700)
* 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

1  2 
Documentation/git-pack-objects.txt
Makefile
index f8a0be351188f39e94c9ffa4dc9a1fcea367e290,f9b97956e36363504192056953d137c0f517f27d..628f296ce1366f728d9a2321bd02e3db492adffb
@@@ -155,8 -155,12 +155,8 @@@ base-name:
        generated pack.  If not specified,  pack compression level is
        determined first by pack.compression,  then by core.compression,
        and defaults to -1,  the zlib default,  if neither is set.
 -      Data copied from loose objects will be recompressed
 -      if core.legacyheaders was true when they were created or if
 -      the loose compression level (see core.loosecompression and
 -      core.compression) is now a different value than the pack
 -      compression level.  Add --no-reuse-object if you want to force
 -      a uniform compression level on all data no matter the source.
 +      Add \--no-reuse-object if you want to force a uniform compression
 +      level on all data no matter the source.
  
  --delta-base-offset::
        A packed archive can express base object of a delta as
        length, this option typically shrinks the resulting
        packfile by 3-5 per-cent.
  
+ --threads=<n>::
+       Specifies the number of threads to spawn when searching for best
+       delta matches.  This requires that pack-objects be compiled with
+       pthreads otherwise this option is ignored with a warning.
+       This is meant to reduce packing time on multiprocessor machines.
+       The required amount of memory for the delta search window is
+       however multiplied by the number of threads.
  --index-version=<version>[,<offset>]::
        This is intended to be used by the test suite only. It allows
        to force the version for the generated pack index, and to force
diff --combined Makefile
index 78cdaa155ba424475fe091cd19cf212e32fcfc2f,a92fb316950155cd0e3d27d61cbf16432b2e3386..40567ece1430e6d59c7f877f9f5861505d22d419
+++ b/Makefile
@@@ -28,8 -28,6 +28,8 @@@ all:
  #
  # Define NO_STRCASESTR if you don't have strcasestr.
  #
 +# Define NO_MEMMEM if you don't have memmem.
 +#
  # Define NO_STRLCPY if you don't have strlcpy.
  #
  # Define NO_STRTOUMAX if you don't have strtoumax in the C library.
  # If not set it defaults to the bare 'wish'. If it is set to the empty
  # string then NO_TCLTK will be forced (this is used by configure script).
  #
+ # Define THREADED_DELTA_SEARCH if you have pthreads and wish to exploit
+ # parallel delta searching when packing objects.
+ #
  
  GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE
        @$(SHELL_PATH) ./GIT-VERSION-GEN
@@@ -283,7 -284,7 +286,7 @@@ LIB_FILE=libgit.
  XDIFF_LIB=xdiff/lib.a
  
  LIB_H = \
 -      archive.h blob.h cache.h commit.h csum-file.h delta.h grep.h \
 +      archive.h blob.h cache.h cache-tree.h commit.h csum-file.h delta.h grep.h \
        diff.h object.h pack.h pkt-line.h quote.h refs.h list-objects.h sideband.h \
        run-command.h strbuf.h tag.h tree.h git-compat-util.h revision.h \
        tree-walk.h log-tree.h dir.h path-list.h unpack-trees.h builtin.h \
@@@ -398,14 -399,12 +401,14 @@@ ifeq ($(uname_S),Darwin
        NEEDS_LIBICONV = YesPlease
        OLD_ICONV = UnfortunatelyYes
        NO_STRLCPY = YesPlease
 +      NO_MEMMEM = YesPlease
  endif
  ifeq ($(uname_S),SunOS)
        NEEDS_SOCKET = YesPlease
        NEEDS_NSL = YesPlease
        SHELL_PATH = /bin/bash
        NO_STRCASESTR = YesPlease
 +      NO_MEMMEM = YesPlease
        NO_HSTRERROR = YesPlease
        ifeq ($(uname_R),5.8)
                NEEDS_LIBICONV = YesPlease
@@@ -428,7 -427,6 +431,7 @@@ ifeq ($(uname_O),Cygwin
        NO_D_TYPE_IN_DIRENT = YesPlease
        NO_D_INO_IN_DIRENT = YesPlease
        NO_STRCASESTR = YesPlease
 +      NO_MEMMEM = YesPlease
        NO_SYMLINK_HEAD = YesPlease
        NEEDS_LIBICONV = YesPlease
        NO_FAST_WORKING_DIRECTORY = UnfortunatelyYes
  endif
  ifeq ($(uname_S),FreeBSD)
        NEEDS_LIBICONV = YesPlease
 +      NO_MEMMEM = YesPlease
        BASIC_CFLAGS += -I/usr/local/include
        BASIC_LDFLAGS += -L/usr/local/lib
  endif
  ifeq ($(uname_S),OpenBSD)
        NO_STRCASESTR = YesPlease
 +      NO_MEMMEM = YesPlease
        NEEDS_LIBICONV = YesPlease
        BASIC_CFLAGS += -I/usr/local/include
        BASIC_LDFLAGS += -L/usr/local/lib
@@@ -463,7 -459,6 +466,7 @@@ ifeq ($(uname_S),NetBSD
  endif
  ifeq ($(uname_S),AIX)
        NO_STRCASESTR=YesPlease
 +      NO_MEMMEM = YesPlease
        NO_STRLCPY = YesPlease
        NEEDS_LIBICONV=YesPlease
  endif
@@@ -475,7 -470,6 +478,7 @@@ ifeq ($(uname_S),IRIX64
        NO_IPV6=YesPlease
        NO_SETENV=YesPlease
        NO_STRCASESTR=YesPlease
 +      NO_MEMMEM = YesPlease
        NO_STRLCPY = YesPlease
        NO_SOCKADDR_STORAGE=YesPlease
        SHELL_PATH=/usr/gnu/bin/bash
@@@ -670,11 -664,12 +673,16 @@@ ifdef NO_HSTRERRO
        COMPAT_CFLAGS += -DNO_HSTRERROR
        COMPAT_OBJS += compat/hstrerror.o
  endif
 +ifdef NO_MEMMEM
 +      COMPAT_CFLAGS += -DNO_MEMMEM
 +      COMPAT_OBJS += compat/memmem.o
 +endif
  
+ ifdef THREADED_DELTA_SEARCH
+       BASIC_CFLAGS += -DTHREADED_DELTA_SEARCH
+       EXTLIBS += -lpthread
+ endif
  ifeq ($(TCLTK_PATH),)
  NO_TCLTK=NoThanks
  endif