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, 03:25 UTC
Message-ID
<alpine.LFD.0.99999.0712062139170.555@xanadu.home>
In-Reply-To
<9e4733910712061737o50a9a5f1ldccdf943bb19319f@mail.gmail.com>
On Thu, 6 Dec 2007, Jon Smirl wrote:
Show 14 quoted lines
> On 12/6/07, Nicolas Pitre <nico@cam.org> wrote:
> > 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.
> 
> How about defaulting it to 20,000 and allowing an override? It's not
> fatal if we guess wrong, we just want to most common cases to work out
> of the box. 20,000 is definitely better than the current window *
> 1000.
Sure.

... But I think this can be made much better than that with no guessing at all.

Say you have 4 threads. then let's divide the whole object list into 4 big segments and feed those to each thread.

One thread will always finish before the others. The idea is to find the active thread with the largest amount of remaining objects to process at that point, and steal half of them and give that to the thread that just finished. Repeat for each thread that completes its segment until everything is done.

Nicolas
Previous: Jon SmirlNext: Andreas Ericsson
Message 4 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.