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

Re: Avoid building object ref lists when not needed

From
Linus Torvalds <torvalds@osdl.org>
Date
Sep 16, 2005, 22:17 UTC
Message-ID
<Pine.LNX.4.58.0509161505410.26803@g5.osdl.org>
In-Reply-To
<Pine.LNX.4.58.0509161446100.26803@g5.osdl.org>
On Fri, 16 Sep 2005, Linus Torvalds wrote:
> 
> and note how the number of pages touched by git-rev-list for this
> particular object list has shrunk from 26,718 (104 MB) to 18,509 (72 MB).

One final note: since I'm only looking at the total page footprint for the process, this _includes_ all the mmap faults of not just the executable, but since my kernel is usign a packed archive, also the actual mapping of the pack itself.

The pack itself is 76MB in size, but obviously not all of it actually needs to be read in. For example, it doesn't need to actually read any of the objects themselves (that's done by the actual packing phase), so we're only touching the "commit" and "tree" parts of the pack.

Of the 72MB, valgrind reports that "only" about 24MB is now used for actual malloc'ed memory. So while the _total_ "touched pages" have shrunk from 187 MB (when I started) to 72 MB (now), the malloc()'ed memory has actually shrunk a lot more (all the savings have been by either avoiding allocations altogether, or by freeing them as soon as we can).

I'm done for the while. There are small wins still to be had, but they are smaller and harder to reach. Maybe I'll get a spurt of energy one of these days, so if somebody finds a particularly problematic load, tell me.

		Linus
Previous: Linus TorvaldsNext: Junio C Hamano
Message 2 of 3 in “Avoid building object ref lists when not needed”
  1. Linus TorvaldsSep 16, 2005
  2. Linus TorvaldsSep 16, 2005
  3. Junio C HamanoSep 16, 2005

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.