From: Junio C Hamano Date: Thu, 02 May 2013 15:46:08 GMT Subject: Re: [PATCH] lookup_object: prioritize recently found objects Message-ID: <7vzjwd1j27.fsf@alter.siamese.dyndns.org> In-Reply-To: <5182101D.4050807@viscovery.net> Johannes Sixt writes: > BTW, do you notice that the function is now modifying an object (the hash > table) even though this is rather unexpected from a "lookup" function? At the philosophical level, "lookup" ought to be operating on a "const" table. But at the implementation level, the table does not have to be "const" in the sense the implemenation language and data structure defines. I think this patch is a good example of that. I am kind of surprised that Jeff's attempt to do a full LRU made things worse, though. The only additional code compared to swap is a single memmove(): are we colliding too often (having to move a lot)?