From: Duy Nguyen Date: Wed, 13 Mar 2013 01:11:00 GMT Subject: Re: [PATCH v2 3/6] match_basename: use strncmp instead of strcmp Message-ID: In-Reply-To: <7v7glc72rn.fsf@alter.siamese.dyndns.org> On Wed, Mar 13, 2013 at 3:59 AM, Junio C Hamano wrote: >>> strncmp is provided length information which could be taken advantage >>> by the underlying implementation. > > After all, strcmp() could also be optimized to fetch word-at-a-time > while being careful about not overstepping the page boundary. It boils down to giving more information to the underlying implementation with hope that it can be useful for something. Although at this point I think strncmp vs strcmp vs memcmp may be not worth doing (we keep explicit length comparison to reduce *cmp calls though). The gain is relatively small and will become even smaller after we avoid running exclude on tracked files (which eliminates like 2/3 of the processed entries). -- Duy