@matheusbsbs / matheus-bagliano / commits / 693b86fffb
Fork 0

threaded delta search: add pack.threads config variable

Signed-off-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Nicolas Pitre committed Sep 10, 2007 at 11:51 UTC 693b86fffb4271dece49f439b133595924a75cbb
2 files changed +20 -1
Documentation/config.txt
+9 -1
@@ -630,9 +630,17 @@ pack.deltaCacheSize::
630 A value of 0 means no limit. Defaults to 0.
631
632 pack.deltaCacheLimit::
633 - The maxium size of a delta, that is cached in
633 + The maximum size of a delta, that is cached in
634 gitlink:git-pack-objects[1]. Defaults to 1000.
635
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 +
644 pull.octopus::
645 The default merge strategy to use when pulling multiple branches
646 at once.
builtin-pack-objects.c
+11
@@ -1746,6 +1746,17 @@ static int git_pack_config(const char *k, const char *v)
1746 cache_max_small_delta_size = git_config_int(k, v);
1747 return 0;
1748 }
1749 + if (!strcmp(k, "pack.threads")) {
1750 + delta_search_threads = git_config_int(k, v);
1751 + if (delta_search_threads < 1)
1752 + die("invalid number of threads specified (%d)",
1753 + delta_search_threads);
1754 +#ifndef THREADED_DELTA_SEARCH
1755 + if (delta_search_threads > 1)
1756 + warning("no threads support, ignoring %s", k);
1757 +#endif
1758 + return 0;
1759 + }
1760 return git_default_config(k, v);
1761 }
1762