From: Linus Torvalds Date: Sat, 12 Jul 2008 22:55:27 GMT Subject: Re: [RFC PATCH] Fix quadratic performance in rewrite_one. Message-ID: In-Reply-To: <200807122200.58187.angavrilov@gmail.com> On Sat, 12 Jul 2008, Alexander N. Gavrilov wrote: > > 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