Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753755Ab0LOHNA (ORCPT ); Wed, 15 Dec 2010 02:13:00 -0500 Received: from smtp1.linux-foundation.org ([140.211.169.13]:41536 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752057Ab0LOHM6 (ORCPT ); Wed, 15 Dec 2010 02:12:58 -0500 MIME-Version: 1.0 In-Reply-To: <20101215055450.GC3398@amd> References: <20101209070938.GA3949@amd> <19324.1291990997@jrobl> <20101213014553.GA6522@amd> <9580.1292225351@jrobl> <20101215043840.GA7692@cr0.nay.redhat.com> <20101215055450.GC3398@amd> From: Linus Torvalds Date: Tue, 14 Dec 2010 23:12:08 -0800 Message-ID: Subject: Re: Big git diff speedup by avoiding x86 "fast string" memcmp To: Nick Piggin Cc: =?ISO-8859-1?Q?Am=E9rico_Wang?= , Nick Piggin , "J. R. Okajima" , linux-arch@vger.kernel.org, x86@kernel.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 830 Lines: 20 On Tue, Dec 14, 2010 at 9:54 PM, Nick Piggin wrote: > > That's what I would like to know, but I suspect that for very short > strings we are dealing with, the custom loop will be fine for > everybody. Yeah, I can pretty much guarantee it for the common case of short strings. Most path components are short enough that a "clever" memcmp() is simply likely going to be slower than doing things byte-per-byte. That's especially true if we then in the future end up making it do a long-by-long compare instead of the byte-by-byte one. Linus -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/