Re: Why Git is so fast

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, May 01, 2009 at 11:42:21AM +0200, Mike Hommey wrote:
> On Fri, May 01, 2009 at 09:24:34AM +0400, Dmitry Potapov wrote:
> > 
> > Good compilers can inline memcpy and should produce more efficient code
> > for the target architecture, which can be faster than manually written.
> > On x86_64, memcpy() requires only 3 load/store operations to copy SHA-1
> > while the above code requires 5 operations.
> 
> I guess, though, that some enforced alignment could help produce
> slightly more efficient code on some architectures (most notably sparc,
> which really doesn't like to deal with unaligned words).

Agreed. Enforcing good alignment may be useful. My point was that avoiding
memcpy with modern compilers is rather pointless or even harmful because the
compiler know more about the target architecture than the author of the code.

Dmitry
--
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

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]