summaryrefslogtreecommitdiff
path: root/Documentation
diff options
context:
space:
mode:
authorLibravatar Andreas Ericsson <ae@op5.se>2008-02-22 20:11:56 -0600
committerLibravatar Junio C Hamano <gitster@pobox.com>2008-02-23 12:00:32 -0800
commit833e3df17188e48b2d31db0966a4051dad5e03b9 (patch)
tree265fb9405efb644ff564ac1b77991d62795006a2 /Documentation
parentSync with 1.5.4.3 (diff)
downloadtgif-833e3df17188e48b2d31db0966a4051dad5e03b9.tar.xz
pack-objects: Add runtime detection of online CPU's
Packing objects can be done in parallell nowadays, but it's only done if the config option pack.threads is set to a value above 1. Because of that, the code-path used is often not the most optimal one. This patch adds a routine to detect the number of online CPU's at runtime (online_cpus()). When pack.threads (or --threads=) is given a value of 0, the number of threads is set to the number of online CPU's. This feature is also documented. As per Nicolas Pitre's recommendations, the default is still to run pack-objects single-threaded unless explicitly activated, either by configuration or by command line parameter. The routine online_cpus() is a rework of "numcpus.c", written by one Philip Willoughby <pgw99@doc.ic.ac.uk>. numcpus.c is in the public domain and can presently be downloaded from http://csgsoft.doc.ic.ac.uk/numcpus/ Signed-off-by: Andreas Ericsson <ae@op5.se> Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/config.txt2
-rw-r--r--Documentation/git-pack-objects.txt2
2 files changed, 4 insertions, 0 deletions
diff --git a/Documentation/config.txt b/Documentation/config.txt
index 7b676710ba..62b697c087 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -808,6 +808,8 @@ pack.threads::
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.
+ Specifying 0 will cause git to auto-detect the number of CPU's
+ and set the number of threads accordingly.
pack.indexVersion::
Specify the default pack index version. Valid values are 1 for
diff --git a/Documentation/git-pack-objects.txt b/Documentation/git-pack-objects.txt
index 8353be186f..5c1bd3b081 100644
--- a/Documentation/git-pack-objects.txt
+++ b/Documentation/git-pack-objects.txt
@@ -177,6 +177,8 @@ base-name::
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.
+ Specifying 0 will cause git to auto-detect the number of CPU's
+ and set the number of threads accordingly.
--index-version=<version>[,<offset>]::
This is intended to be used by the test suite only. It allows