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

Re: [RFC] Dynamic window size on repack?

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Jul 8, 2007, 21:35 UTC
Message-ID
<alpine.LFD.0.999.0707081429500.31544@woody.linux-foundation.org>
In-Reply-To
<20070708211606.GF4087@lavos.net>
On Sun, 8 Jul 2007, Brian Downing wrote:
Show 12 quoted lines
> 
> I think what I'd like is an extra option to repack to limit window
> memory usage.  This would dynamically scale the window size down if it
> can't fit within the limit, then scale it back up once you're off of the
> nasty file.  This would let me repack my repository with --window=100
> and have it actually finish someday on the machines I have access to.
> The big file may not be as efficiently packed as possible, but I can
> live with that.
> 
> My question is, is this sane?  Does the repack algorithm depend on having
> a fixed window size to work?  I'd rather not look into implementing this
> if it's silly on the face of it.

It doesn't sound silly, and it should even be fairly easy. The window code is all in builtin-pack-objects.c (find_deltas()) and while it's currently coded for a constant-sized window, it shouldn't be too hard to free more old entries if you allocate one big one to make sure that the "array" thing doesn't grow to contain too much data.

In other words, just look at how the variables "struct unpacked *array" (the whole window array) and the "struct unpacked *n" (the "next entry" in the array using a simple circular queue using "idx") are accessed.

		Linus
Previous: Dana HowNext: Linus Torvalds
Message 3 of 4 in “[RFC] Dynamic window size on repack?”
  1. Brian DowningJul 8, 2007
  2. Dana HowJul 8, 2007
  3. Linus TorvaldsJul 8, 2007
  4. Linus TorvaldsJul 8, 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.