From: Junio C Hamano Date: Fri, 14 Nov 2008 20:14:23 GMT Subject: Re: hosting git on a nfs Message-ID: <7v63mq9iao.fsf@gitster.siamese.dyndns.org> In-Reply-To: Linus Torvalds writes: > I also think the thread cost was wrong: it did > > threads = index->cache_nr / 100; > > to give a first-order "how many threads do we want", but the thread > startup is likely to be higher than 100 lstat calls, so we probably want > fewer threads than that. It doesn't much matter for something like the > Linux kernel, where there are so many files that we'll end up maxing out > the threads anyway, but for smaller projects, I suspect a thread cost of > "one thread per 500 files" is more reasonable. You almost certainly don't > want to thread anything at all for fewer than a few hundred files. If you have 1000 files in a single directory, do you still want 2 threads following the "1/500" rule, or they would compete reading the same directory and using a single thread is better off?