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

Re: [PATCH] Implement limited context matching in git-apply.

From
Linus Torvalds <torvalds@osdl.org>
Date
Apr 10, 2006, 15:25 UTC
Message-ID
<Pine.LNX.4.64.0604100821340.9504@g5.osdl.org>
In-Reply-To
<m1irphhj1p.fsf_-_@ebiederm.dsl.xmission.com>
On Mon, 10 Apr 2006, Eric W. Biederman wrote:
Show 7 quoted lines
> 
> If I just loop through all of Andrews patches in order
> and run git-apply --index -C1 I process the entire patchset
> in 1m53s or about 6 patches per second.  So running
> git-mailinfo, git-write-tree, git-commit-tree, and
> git-update-ref everytime has a measurable impact,
> and shows things can be speeded up even more.

git-write-tree is actually a fairly expensive operation on the kernel. It needs to write the 1000+ tree objects - and while _most_ of them already exist (and thus don't actually need to be written out), we need to generate the tree object and its SHA1 in order to notice that that is the case.

I'm almost certain that 90%+ of the overhead you see is the tree writing, not the rest of the scripting.

Your patch looks ok from a quick read-through:
Acked-by: Linus Torvalds <torvalds@osdl.org>
		Linus
Previous: Eric W. BiedermanNext: Eric W. Biederman
Message 4 of 8 in “Implement --fuzz= option for git-apply.”
  1. Implement --fuzz= option for git-apply.Eric W. Biederman, Apr 10, 2006
  2. Eric W. BiedermanApr 10, 2006
  3. Implement limited context matching in git-apply.Eric W. Biederman, Apr 10, 2006
  4. Linus TorvaldsApr 10, 2006
  5. Eric W. BiedermanApr 10, 2006
  6. Linus TorvaldsApr 11, 2006
  7. Eric W. BiedermanApr 13, 2006
  8. Junio C HamanoApr 10, 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.