Re: Make GIT_USE_LOOKUP default?
- From
Jeff King <peff@peff.net>
- Date
- Mar 19, 2013, 15:55 UTC
- Message-ID
- <20130319155544.GB10010@sigill.intra.peff.net>
- In-Reply-To
- <CACsJy8BxbJU9-7Q-Ef3cG2VV2cW8YbBGcjNT9wjT+JywDOxyNg@mail.gmail.com>
On Tue, Mar 19, 2013 at 10:43:40PM +0700, Nguyen Thai Ngoc Duy wrote:
Show 12 quoted lines
> > I could not replicate his benchmarks at all. In fact, my measurements > > showed a slight slowdown with 1a812f3 (hashcmp(): inline memcmp() by > > hand to optimize, 2011-04-28). > [...] > > What gcc and glibc versions are you using? With gcc 4.5.3 I got "repz > cmpsb" after reverting the patch, just like what Ingo described > (although interestingly it ran a bit faster than current master, glibc > 2.11.2 on Atom D510 32 bit). gcc 4.6.3 -O2 (on another machine, 64 > bit) produced a call to libc's memcmp instead of "repz cmpsb". I guess > if "repz cmpsb" is what we are against, then we could pass > -fno-builtin-memcmp (potential impact to other parts of git though).
I have glibc 2.13. And looking at the changelog, there were a ton of ssse-optimized memcmp implementations that went into 2.13 [1], so I suspect that is what is going on.
-Peff
PS As a side note, you may recall a year or two ago when these went in, because the initial versions walked backwards, meaning memcpys of overlapping regions started to fail (as they are allowed to, but many programs do not properly use memmove).