From: Junio C Hamano Date: Wed, 26 May 2010 05:07:13 GMT Subject: Re: [PATCH] remove over-eager caching in sha1_file_name Message-ID: <7vtypvqmim.fsf@alter.siamese.dyndns.org> In-Reply-To: <20100522065942.GB11335@coredump.intra.peff.net> Jeff King writes: > Actually, thinking on it more, micro-optimizing this is really > pointless. I was thinking that it would get called a lot, so we need to > care. But the next step is almost certainly to open, mmap, and zlib > decompress the resulting object, which is way more expensive. > > So here it is with caching ripped out. More readable and more robust, > and I'm sure we can afford an extra strlen() and memcpy() on each object > lookup. Makes sense; thanks.