Re: [PATCH] check_updates(): effective removal of cache entries marked CE_REMOVE
- From
Linus Torvalds <torvalds@linux-foundation.org>
- Date
- Feb 18, 2009, 22:44 UTC
- Message-ID
- <alpine.LFD.2.00.0902181436390.21686@localhost.localdomain>
- In-Reply-To
- <1234995483-933-1-git-send-email-barvik@broadpark.no>
On Wed, 18 Feb 2009, Kjetil Barvik wrote:
> > To fix this, and use an O(N) algorithm instead, where N is the number > of cache_entries, we delete/remove all entries in one loop through all > entries.
Ack. We've had things like this before. I'm somewhat surprised that it is noticeable even in the "o->update" case (since I would have expected the cost of actually doing an unlink() to swamp the memmove overhead), but the patch looks obviously correct.
Looking at the numbers, I guess it's not _really_ noticeable - it's 1.8% of git user-space time, which in turn is about 75% of total time, so it's not a huge improvement, but I'll certainly ack it anyway as being the right thing to do. Every little bit helps.
Linus