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

Re: [RFC PATCH] Fix quadratic performance in rewrite_one.

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Jul 12, 2008, 22:55 UTC
Message-ID
<alpine.LFD.1.10.0807121550320.2959@woody.linux-foundation.org>
In-Reply-To
<200807122200.58187.angavrilov@gmail.com>
On Sat, 12 Jul 2008, Alexander N. Gavrilov wrote:
Show 5 quoted lines
>
> Parent commits are usually older than their children. Thus,
> on each iteration of the loop in rewrite_one, add_parents_to_list
> traverses all commits previously processed by the loop.
> It performs very poorly in case of very long rewrite chains.

Good call, but you don't seem to invalidate the cache when we remove things from the list.

The top of the limit_list() loop does that "get top entry from list, an free it", and I'm not seeing you invalidating the cache if that entry that just got free'd happened to be the cache entry?

Or did I miss some reason why that couldn't happen? 
		Linus
Previous: Alexander N. GavrilovNext: Alexander Gavrilov
Message 2 of 3 in “Fix quadratic performance in rewrite_one.”
  1. Fix quadratic performance in rewrite_one.Alexander N. Gavrilov, Jul 12, 2008
  2. Linus TorvaldsJul 12, 2008
  3. Alexander GavrilovJul 13, 2008

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.