git/list[1] front-page[2] threads[3] people[4] search[5] about
 

RE: [PATCH v4] Add git-grep threads param

From
VLVictor Leschuk <vleschuk@accesssoftek.com>
Date
Nov 9, 2015, 21:51 UTC
Message-ID
<6AE1604EE3EC5F4296C096518C6B77EE5D0FDABA1B@mail.accesssoftek.com>
In-Reply-To
<CA+55aFyhBN5fEpB-CLQFhhDyf7nijs_Y3aZCSQAcpVPmruZLFg@mail.gmail.com>
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

Previous: Stefan Beller
Message 19 of 19 in “Add git-grep threads param”
  1. Add git-grep threads paramVictor Leschuk, Oct 27, 2015
  2. Victor LeschukNov 2, 2015
  3. Junio C HamanoNov 2, 2015
  4. Victor LeschukNov 3, 2015
  5. Junio C HamanoNov 3, 2015
  6. Jeff KingNov 4, 2015
  7. Victor LeschukNov 9, 2015
  8. Jeff KingNov 9, 2015
  9. Victor LeschukNov 9, 2015
  10. Jeff KingNov 9, 2015
  11. Victor LeschukNov 9, 2015
  12. Jeff KingNov 9, 2015
  13. Linus TorvaldsNov 9, 2015
  14. Jeff KingNov 9, 2015
  15. Victor LeschukNov 9, 2015
  16. Linus TorvaldsNov 9, 2015
  17. Victor LeschukNov 9, 2015
  18. Stefan BellerNov 9, 2015
  19. Victor LeschukNov 9, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.