@matheusbsbs / matheus-bagliano / commits / 43cc2b4266
Fork 0

autodetect number of CPUs by default when using threads

... and display the actual number of threads used when locally repacking. A remote server still won't tell you how many threads it uses during a fetch though. Signed-off-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Nicolas Pitre committed Dec 11, 2008 at 15:36 UTC 43cc2b4266cc75f1a5a10e1a805d05e419000573
1 file changed +4 -1
builtin-pack-objects.c
+4 -1
@@ -78,7 +78,7 @@ static int progress = 1;
78 static int window = 10;
79 static uint32_t pack_size_limit, pack_size_limit_cfg;
80 static int depth = 50;
81 -static int delta_search_threads = 1;
81 +static int delta_search_threads;
82 static int pack_to_stdout;
83 static int num_preferred_base;
84 static struct progress *progress_state;
@@ -1612,6 +1612,9 @@ static void ll_find_deltas(struct object_entry **list, unsigned list_size,
1612 find_deltas(list, &list_size, window, depth, processed);
1613 return;
1614 }
1615 + if (progress > pack_to_stdout)
1616 + fprintf(stderr, "Delta compression using %d threads.\n",
1617 + delta_search_threads);
1618
1619 /* Partition the work amongst work threads. */
1620 for (i = 0; i < delta_search_threads; i++) {