Subject: Re: [PATCH] git gc: Speed it up by 18% via faster hash comparisons

From: "H. Peter Anvin" <[email-masked]>
Date: Fri, 29 Apr 2011 09:24:08 -0700

On 04/29/2011 12:05 AM, Alex Riesen wrote:
> 
> Can one take advantage of common expression optimization here?
> Like this:
> 
> +       if (*sha1 - *sha2)
> +               return *sha1 - *sha2;
> 

Or even clue the compiler in explicitly:

	delta = *sha1 - *sha2;
	if (delta)
		return delta;

For newer x86-specific optimization there are a bunch of newer SSE
instructions which can be used to do bulk compares which may be faster
if optimized for the fixed length compare; of course it requires a new
enough processor.

	-hpa

-- 
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel.  I don't speak on their behalf.