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

Re: Better value for chunk_size when threaded

From
Nicolas Pitre <nico@cam.org>
Date
Dec 7, 2007, 01:27 UTC
Message-ID
<alpine.LFD.0.99999.0712062014060.555@xanadu.home>
In-Reply-To
<9e4733910712061558k19fbc864ia1fb7a3431fd2603@mail.gmail.com>
On Thu, 6 Dec 2007, Jon Smirl wrote:
> I tried some various ideas out for chunk_size and the best strategy I
> found was to simply set it to a constant. How does 20,000 work on
> other CPUs?

That depends on the object size. If you have a repo with big objects but only 1000 of them for example, then the constant doesn't work.

Ideally I'd opt for a value that tend towards around 5 seconds worth of work per segment, or something like that. Maybe using the actual objects size could be another way.

> I'd turn on default threaded support with this change. With threads=1
> versus non-threaded there is no appreciable difference in the time.
Would need a way to determine pthreads availability from Makefile.
> Is there an API to ask how many CPUs are in the system? It would be
> nice to default the number of threads equal to the number of CPUs and
> only use pack.threads=X to override.

If there is one besides futzing with /proc/cpuinfo I'd like to know about it. Bonus points if it is portable.

Nicolas
Previous: Jon SmirlNext: Jon Smirl
Message 2 of 7 in “Better value for chunk_size when threaded”
  1. Jon SmirlDec 6, 2007
  2. Nicolas PitreDec 7, 2007
  3. Jon SmirlDec 7, 2007
  4. Nicolas PitreDec 7, 2007
  5. Andreas EricssonDec 10, 2007
  6. Nicolas PitreDec 10, 2007
  7. Andreas EricssonDec 7, 2007

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.