Re: [RFC PATCH 0/2] Add support for multi threaded checkout
- From
- James Pickens <jepicken@gmail.com>
- Date
- Dec 19, 2008, 01:04 UTC
- Message-ID
- <885649360812181704l3a905ebfrb90f391e86004efc@mail.gmail.com>
- In-Reply-To
- <494ABDC9.9060001@morey-chaisemartin.com>
On Thu, Dec 18, 2008, Nicolas Morey-Chaisemartin <devel@morey-chaisemartin.com> wrote:
> I guess you could do something like : > > #define checkout_lock() core_threaded_checkout ?pthread_mutex_lock(&checkout_mutex) : (void) 0 > #define checkout_unlock() core_threaded_checkout ?pthread_mutex_unlock(&checkout_mutex) : (void) 0
I tried that, and to make it easier to see the impact, I changed the 'wrote = write_in_full(...)' calls in entry.c to 'wrote = size'. That makes git just create a bunch of empty files instead of writing the real contents to disk. Here's the result, with core.threadedcheckout set to false, best of 2 runs:
original patch: 3.19 original + above: 3.18
So the cost of locking/unlocking the mutex looks vanishingly small in the single thread case.
This also puts an upper bound on the time required for a single thread to unpack the data.
James