Re: Linus' sha1 is much faster!

2009-08-26 Thread Pádraig Brady
Nicolas Pitre wrote: On Sat, 15 Aug 2009, Linus Torvalds wrote: (Heh. Looking at that, I probably should move the 'size' field first, since that would have different alignment rules, and the struct would be more tightly packed that way, and initialize better). I was about to suggest

Re: Linus' sha1 is much faster!

2009-08-17 Thread Giuseppe Scrivano
Pádraig Brady p...@draigbrady.com writes: -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i586 -mtune=generic -fasynchronous-unwind-tables -D_GNU_SOURCE=1 thanks. I did again all tests on my machine using these same

Re: Linus' sha1 is much faster!

2009-08-17 Thread Andreas Ericsson
Linus Torvalds wrote: On Sat, 15 Aug 2009, Linus Torvalds wrote: That said, I don't know if the MPL is ok for X11. I've not looked at compatibility issues with MPL. For git, we could just ignore the MPL, since the GPLv2 was acceptable regardless of it. If MPL isn't ok for X11, then we'd

Re: Linus' sha1 is much faster!

2009-08-17 Thread Steven Noonan
On Mon, Aug 17, 2009 at 3:51 AM, Giuseppe Scrivanogscriv...@gnu.org wrote: Pádraig Brady p...@draigbrady.com writes:   -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions   -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i586   -mtune=generic -fasynchronous-unwind-tables

Re: Linus' sha1 is much faster!

2009-08-17 Thread Linus Torvalds
On Mon, 17 Aug 2009, Steven Noonan wrote: Interesting. I compared Linus' implementation to the public domain one by Steve Reid[1] You _really_ need to talk about what kind of environment you have. There are three major issues: - Netburst vs non-netburst - 32-bit vs 64-bit - compiler

Re: Linus' sha1 is much faster!

2009-08-17 Thread Giuseppe Scrivano
Hi, These are the results I reported (median of 5 plus an additional not considered first run) on the Steve Reid's SHA1 implementation using the same flags to the compiler that I used for previous tests. GCC 4.3.3: real0m2.627s GCC 4.4.1: real0m3.742s In both cases it showed

Re: Linus' sha1 is much faster!

2009-08-17 Thread Steven Noonan
On Mon, Aug 17, 2009 at 9:22 AM, Linus Torvaldstorva...@linux-foundation.org wrote: On Mon, 17 Aug 2009, Steven Noonan wrote: Interesting. I compared Linus' implementation to the public domain one by Steve Reid[1] You _really_ need to talk about what kind of environment you have. There

Re: Linus' sha1 is much faster!

2009-08-16 Thread Giuseppe Scrivano
Hi Pádraig, I tried to reproduce your results but I wasn't able to do it. The biggest difference on a 300MB file I noticed was approximately 15% using on both implementations -O2, and 5% using -O3. My GCC version is gcc (Debian 4.3.3-14) 4.3.3 and the CPU is: Intel(R) Pentium(R) D CPU 3.20GHz.

Re: Linus' sha1 is much faster!

2009-08-16 Thread Linus Torvalds
On Sun, 16 Aug 2009, Giuseppe Scrivano wrote: My GCC version is gcc (Debian 4.3.3-14) 4.3.3 and the CPU is: Intel(R) Pentium(R) D CPU 3.20GHz. Netburst is very sensitive to random spill effects, and you can basically tune things by just code shuffling that just has random effects on the

Re: Linus' sha1 is much faster!

2009-08-16 Thread Giuseppe Scrivano
Linus Torvalds torva...@linux-foundation.org writes: I pretty much can guarantee you that it improves things only because it makes gcc generate crap code, which then hides some of the P4 issues. I'd also suggest you try gcc-4.4, since that apparently fixes some of the oddest spill issues.

Re: Linus' sha1 is much faster!

2009-08-16 Thread Linus Torvalds
On Mon, 17 Aug 2009, Giuseppe Scrivano wrote: Thanks for the hint. I tried gcc-4.4 and it produces slower code than 4.3 on the gnulib SHA1 implementation and my patch makes it even more! Check out the asm, see if you can see why. One of the most common problems with P4's is literally that

Re: Linus' sha1 is much faster!

2009-08-16 Thread Pádraig Brady
Giuseppe Scrivano wrote: Hi Pádraig, I tried to reproduce your results but I wasn't able to do it. The biggest difference on a 300MB file I noticed was approximately 15% using on both implementations -O2, and 5% using -O3. My GCC version is gcc (Debian 4.3.3-14) 4.3.3 and the CPU is:

Re: Linus' sha1 is much faster!

2009-08-16 Thread Nicolas Pitre
On Sat, 15 Aug 2009, Linus Torvalds wrote: (Heh. Looking at that, I probably should move the 'size' field first, since that would have different alignment rules, and the struct would be more tightly packed that way, and initialize better). I was about to suggest (i.e. post) a patch for

Re: Linus' sha1 is much faster!

2009-08-15 Thread Bryan Donlan
2009/8/14 Pádraig Brady p...@draigbrady.com: I've noticed before that coreutils hashing utils were a little behind in performance, but was prompted to look at it again when I noticed the recently updated sha1 implementation in git:

Re: Linus' sha1 is much faster!

2009-08-15 Thread John Tapsell
2009/8/15 Bryan Donlan bdon...@gmail.com: coreutils is licensed under GPLv3, and git under GPLv2 (only), so you'd need permission from all contributors to the implementation in order to relicense under GPLv3. A quick grep of the history suggests these contributors to be: X11 also requires a

Re: Linus' sha1 is much faster!

2009-08-15 Thread Linus Torvalds
On Sat, 15 Aug 2009, Linus Torvalds wrote: That said, I don't know if the MPL is ok for X11. I've not looked at compatibility issues with MPL. For git, we could just ignore the MPL, since the GPLv2 was acceptable regardless of it. If MPL isn't ok for X11, then we'd need to make sure that

Re: Linus' sha1 is much faster!

2009-08-15 Thread Theodore Tso
On Sat, Aug 15, 2009 at 09:12:58PM +0100, John Tapsell wrote: 2009/8/15 Bryan Donlan bdon...@gmail.com: coreutils is licensed under GPLv3, and git under GPLv2 (only), so you'd need permission from all contributors to the implementation in order to relicense under GPLv3. A quick grep of the

Linus' sha1 is much faster!

2009-08-14 Thread Pádraig Brady
I've noticed before that coreutils hashing utils were a little behind in performance, but was prompted to look at it again when I noticed the recently updated sha1 implementation in git: http://git.kernel.org/?p=git/git.git;a=history;f=block-sha1;h=d3121f7;hb=pu Testing that with the attached