git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] autodetect number of CPUs by default when using threads
@ 2008-12-11 20:36 Nicolas Pitre
  2008-12-11 22:25 ` Junio C Hamano
  2008-12-13 13:32 ` Jeff King
  0 siblings, 2 replies; 11+ messages in thread
From: Nicolas Pitre @ 2008-12-11 20:36 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

... 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>
---

I've spent quite a while wondering why repacking in one repo was faster 
than repacking in a clone of that repo on the same machine.  So let's 
display how many threads are actually used.

We have comprehensive test in Makefile to determine if threads are 
available, just to not use them by default.  I think that code has 
proven itself for long enough now not to let people benefit from it.

diff --git a/builtin-pack-objects.c b/builtin-pack-objects.c
index cedef52..619e597 100644
--- a/builtin-pack-objects.c
+++ b/builtin-pack-objects.c
@@ -78,7 +78,7 @@ static int progress = 1;
 static int window = 10;
 static uint32_t pack_size_limit, pack_size_limit_cfg;
 static int depth = 50;
-static int delta_search_threads = 1;
+static int delta_search_threads;
 static int pack_to_stdout;
 static int num_preferred_base;
 static struct progress *progress_state;
@@ -1612,6 +1612,9 @@ static void ll_find_deltas(struct object_entry **list, unsigned list_size,
 		find_deltas(list, &list_size, window, depth, processed);
 		return;
 	}
+	if (progress > pack_to_stdout)
+		fprintf(stderr, "Delta compression using %d threads.\n",
+				delta_search_threads);
 
 	/* Partition the work amongst work threads. */
 	for (i = 0; i < delta_search_threads; i++) {

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2008-12-16  5:22 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-11 20:36 [PATCH] autodetect number of CPUs by default when using threads Nicolas Pitre
2008-12-11 22:25 ` Junio C Hamano
2008-12-12  0:55   ` Nicolas Pitre
2008-12-13 13:32 ` Jeff King
2008-12-13 19:27   ` Nicolas Pitre
2008-12-13 20:06   ` [PATCH] pack-objects: don't use too many threads with few objects Nicolas Pitre
2008-12-14  2:20     ` Jeff King
2008-12-15 18:38     ` Mike Ralphson
2008-12-16  1:15       ` Junio C Hamano
2008-12-16  3:20         ` Jeff King
2008-12-16  5:21         ` Nicolas Pitre

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).