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

Re: performance on repack

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Aug 11, 2007, 22:34 UTC
Message-ID
<alpine.LFD.0.999.0708111529310.30176@woody.linux-foundation.org>
In-Reply-To
<85ps1tsozb.fsf@lola.goethe.zz>
On Sun, 12 Aug 2007, David Kastrup wrote:
Show 9 quoted lines
> "Jon Smirl" <jonsmirl@gmail.com> writes:
> 
> > If anyone is bored and looking for something to do, making the delta
> > code in git repack multithreaded would help.
> 
> I severely doubt that.  It is like the "coding stuff in assembly
> language will make it faster" myth.  The problem is that of manageable
> complexity.  Making the stuff multithreaded or coded in assembly means
> that it becomes inaccessible for a sound algorithmic redesign.

I have to admit that I'm not a huge fan of threading: the complexity and locking often kills you, if memory bandwidth constraints do not, and the end result is often really really hard to debug.

That said, I suspect we could some some *simple* form of this by just partitioning the problem space up - we could have a MT repack that generates four *different* packs on four different CPU's: each thread taking one quarter of the objects. At that point, you wouldn't even need threads, you could do it with regular processes, since the problem set is fully partitioned ocne you've generated the list of objects!

Then, after you've generated four different packs, doing a "git gc" (without any threading) will repack them into one big pack, and mostly just re-use the existing deltas.

So this would not be a generic thing, but it could be somethign that is useful for the forced full-repack after importing a large repository with fast-import, for example.

So while I agree with David in general about the problem of threading, I think that we can possibly simplify the special case of repacking into something less complicated than a "real" multi-threading problem.

		Linus
Previous: David KastrupNext: Jon Smirl
Message 3 of 30 in “performance on repack”
  1. Jon SmirlAug 11, 2007
  2. David KastrupAug 11, 2007
  3. Linus TorvaldsAug 11, 2007
  4. Jon SmirlAug 11, 2007
  5. Martin KoeglerAug 12, 2007
  6. Jon SmirlAug 12, 2007
  7. Shawn O. PearceAug 14, 2007
  8. Jon SmirlAug 14, 2007
  9. Shawn O. PearceAug 14, 2007
  10. Jon SmirlAug 14, 2007
  11. Nicolas PitreAug 14, 2007
  12. Nicolas PitreAug 14, 2007
  13. Jon SmirlAug 15, 2007
  14. Nicolas PitreAug 15, 2007
  15. Shawn O. PearceAug 15, 2007
  16. Jon SmirlAug 15, 2007
  17. Martin KoeglerAug 15, 2007
  18. Jon SmirlAug 15, 2007
  19. Nicolas PitreAug 15, 2007
  20. Jon SmirlAug 15, 2007
  21. David KastrupAug 16, 2007
  22. Nicolas PitreAug 16, 2007
  23. Jon SmirlAug 16, 2007
  24. Nicolas PitreAug 16, 2007
  25. Nicolas PitreAug 15, 2007
  26. Nicolas PitreAug 15, 2007
  27. Nicolas PitreAug 30, 2007
  28. Nicolas PitreAug 30, 2007
  29. Jon SmirlAug 30, 2007
  30. Jon SmirlSep 1, 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.