Re: [PATCH] fast-import: use hashcmp() for SHA1 hash comparison
- From
Jeff King <peff@peff.net>
- Date
- Jul 18, 2014, 23:57 UTC
- Message-ID
- <20140718235706.GA11192@peff.net>
- In-Reply-To
- <53C971FD.6040500@web.de>
On Fri, Jul 18, 2014 at 09:14:05PM +0200, René Scharfe wrote:
Show 5 quoted lines
> If inlining is really better is another matter; I don't understand how > 1a812f3a (hashcmp(): inline memcmp() by hand to optimize) could have made > git gc 18% faster, as it claimed. I would expect memcmp(), which can > compare more than a byte at a time, to be significantly faster -- or at > least just as fast as whatever the compiler does with the inlined version.
I looked into this a while ago[1]. I think with glibc 2.13 and up, the memcmp is a win. We should consider switching back if that is what is common now.
-Peff
[1] http://article.gmane.org/gmane.comp.version-control.git/218396