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. -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html