Correct.

I think adding the option (both to command line and to config file) is good, as 
long as the IO issues are documented. And default to just the fixed number of 
threads for now - and with the option, maybe people can then more easily try 
out different scenarios and maybe improve on the particular choice of fixed 
number of threads.

> Or maybe the default should be something that isn't even described by any 
> particular fixed number.

> For example, maybe the default that value could be something quite dynamic: 
> start off with a single thread (or a very low thread number) and just set a 
> timer. After 0.1s, if CPU usage is low, start more threads. After another 
> 0.1s, if that improved things, maybe > we could add still more threads...

> Note that "CPU usage is low" can be hard to get portably, but we could 
> approximate it with "how much work did we actually get done". If we only 
> grepped a couple of files, that might be because of IO issues. And if speed 
> does not improve when we move from a 
> single thread to, say, four threads, then we should probably *not* increase 
> the thread number again at 0.2s.

> So I think there are many possible avenues to explore that might be 
> interesting. I do *not* think that "online_cpus()" is one of them, > except 
> perhaps as a very rough measure of "is this a beefy system or not" (but even 
> that is questionable - 32 CPUs is definitely 
> likely "very beefy, so use lots of threads", but even 8 CPUs might still be 
> just a phone, and I'm not sure that tells you a lot, really.
    Linus

Here is my version of note for Documentaion:

        Number of grep worker threads, use it to tune up performance on
        your machines. Leave it unset or set to "0" if you want to use default 
number
        (currently default number is 8 for all systems, however this behavior 
can
         be changed in future versions to better suite your hardware and 
circumstances).


--
Victor

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to