Re: [PATCH v5 2/5] read-cache: load cache extensions on a worker thread

2018-09-17 Thread Junio C Hamano
Duy Nguyen writes: >> diff --git a/read-cache.c b/read-cache.c >> index 858935f123..b203eebb44 100644 >> --- a/read-cache.c >> +++ b/read-cache.c >> @@ -23,6 +23,10 @@ >> #include "split-index.h" >> #include "utf8.h" >> #include "fsmonitor.h" >> +#ifndef NO_PTHREADS >> +#include >> +#include

Re: [PATCH v5 2/5] read-cache: load cache extensions on a worker thread

2018-09-17 Thread Junio C Hamano
Duy Nguyen writes: > On Sat, Sep 15, 2018 at 12:22 PM Duy Nguyen wrote: >> Wait there's no way to disable this parallel reading? Does not sound >> right. And if ordinary numbers mean the number of threads then 0 >> should mean no threading. Auto detection could have a new keyword, >> like 'auto

Re: [PATCH v5 2/5] read-cache: load cache extensions on a worker thread

2018-09-17 Thread Duy Nguyen
On Mon, Sep 17, 2018 at 6:26 PM Ben Peart wrote: > > > > On 9/15/2018 6:22 AM, Duy Nguyen wrote: > >> +index.threads:: > >> + Specifies the number of threads to spawn when loading the index. > >> + This is meant to reduce index load time on multiprocessor machines. > >> + Specify

Re: [PATCH v5 2/5] read-cache: load cache extensions on a worker thread

2018-09-17 Thread Ben Peart
On 9/15/2018 6:24 AM, Duy Nguyen wrote: On Sat, Sep 15, 2018 at 12:22 PM Duy Nguyen wrote: @@ -1944,6 +1993,26 @@ int do_read_index(struct index_state *istate, const char *path, int must_exist) istate->cache = xcalloc(istate->cache_alloc, sizeof(*istate->cache)); istate->i

Re: [PATCH v5 2/5] read-cache: load cache extensions on a worker thread

2018-09-17 Thread Ben Peart
On 9/15/2018 6:22 AM, Duy Nguyen wrote: +index.threads:: + Specifies the number of threads to spawn when loading the index. + This is meant to reduce index load time on multiprocessor machines. + Specifying 0 or 'true' will cause Git to auto-detect the number of + CPU's

Re: [PATCH v5 2/5] read-cache: load cache extensions on a worker thread

2018-09-15 Thread Duy Nguyen
On Sat, Sep 15, 2018 at 12:22 PM Duy Nguyen wrote: > Wait there's no way to disable this parallel reading? Does not sound > right. And if ordinary numbers mean the number of threads then 0 > should mean no threading. Auto detection could have a new keyword, > like 'auto'. My bad. Disabling threa

Re: [PATCH v5 2/5] read-cache: load cache extensions on a worker thread

2018-09-15 Thread Duy Nguyen
On Sat, Sep 15, 2018 at 12:22 PM Duy Nguyen wrote: > > @@ -1944,6 +1993,26 @@ int do_read_index(struct index_state *istate, const > > char *path, int must_exist) > > istate->cache = xcalloc(istate->cache_alloc, > > sizeof(*istate->cache)); > > istate->initialized = 1; > > > > +

Re: [PATCH v5 2/5] read-cache: load cache extensions on a worker thread

2018-09-15 Thread Duy Nguyen
On Wed, Sep 12, 2018 at 6:18 PM Ben Peart wrote: > > This patch helps address the CPU cost of loading the index by loading > the cache extensions on a worker thread in parallel with loading the cache > entries. > > In some cases, loading the extensions takes longer than loading the > cache entries

[PATCH v5 2/5] read-cache: load cache extensions on a worker thread

2018-09-12 Thread Ben Peart
This patch helps address the CPU cost of loading the index by loading the cache extensions on a worker thread in parallel with loading the cache entries. In some cases, loading the extensions takes longer than loading the cache entries so this patch utilizes the new EOIE to start the thread to loa