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

[PATCH 0/4] Start migrating away from the "struct tree_entry" list

From
Linus Torvalds <torvalds@osdl.org>
Date
May 28, 2006, 22:03 UTC
Message-ID
<Pine.LNX.4.64.0605281453460.5623@g5.osdl.org>

The old "tree.h" parsing logic (before I did the "tree-walk" tree buffer parser) would generate a list of "struct tree_entry" objects, which was basically a simpler-to-walk version of the raw tree buffer.

Now, the problem with that simpler-to-walk version is that it's a lot less efficient than just walking the raw tree buffer in-place, and a lot of the core git tree walkers already use the much more efficient in-place tree-walker interfaces. Which means that we have _two_ independent ways of walking the tree. Very annoying.

This series of four patches (on top of my trivial memory leak fix for git rev-list) gets rid of the tree-entry list from tree parsing, and converts most users over to use the tree-walker, and has a small compatibility helper function to keep some users that are hard to convert using what is now obviously just a temporary list.

Apart from being one more step in the direction of cleaning up tree walking, it also makes things more efficient, by not needlessly creating that silly list that most users don't actually want. I used the same test vector as I did for the git rev-list leaker: doing a

	git-rev-list --all --objects

on the historical kernel archive (that one has 566k objects and is more than twice the size of the current kernel git tree). The series brings that down from

	74.67user 0.45system 1:15.43elapsed
to
	62.50user 0.41system 1:02.93elapsed
for me.

NOTE! I think the git-rev-list leak fix can go into the main tree immediately, but this series should probably be kept in "next" for a while, just to verify that it all is good..

		Linus
Next: Linus Torvalds
Message 1 of 5 in “Start migrating away from the "struct tree_entry" list”
  1. 0/4 Start migrating away from the "struct tree_entry" listLinus Torvalds, May 28, 2006
  2. 1/4 Add raw tree buffer info to "struct tree"Linus Torvalds, May 28, 2006
  3. 2/4 Make "tree_entry" have a SHA1 instead of a union of object pointersLinus Torvalds, May 28, 2006
  4. 3/4 Switch "read_tree_recursive()" over to tree-walk functionalityLinus Torvalds, May 28, 2006
  5. 4/4 Remove "tree->entries" tree-entry list from tree parserLinus Torvalds, May 28, 2006

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.