Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Feb 23, 2008

  1. Andreas Ericsson

    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 <>. numcpus.c is in the
    public domain and can presently be downloaded from
    Signed-off-by: Andreas Ericsson <>
    Signed-off-by: Brandon Casey <>
    Signed-off-by: Junio C Hamano <>
    authored February 22, 2008 gitster committed February 23, 2008
Something went wrong with that request. Please try again.