From: Linus Torvalds Date: Fri, 22 Apr 2005 15:31:55 GMT Subject: Re: Mozilla SHA1 implementation Message-ID: In-Reply-To: <17000.43340.760901.175004@cargo.ozlabs.ibm.com> On Fri, 22 Apr 2005, Paul Mackerras wrote: > Linus Torvalds writes: > > > Interestingly, the Mozilla SHA1 code is about twice as fast as the openssl > > code on my G5, and judging by the disassembly, it's because it's much > > simpler. I think the openssl people have unrolled all the loops totally, > > which tends to be a disaster on any half-way modern CPU. But hey, it could > > be something as simple as optimization flags too. > > Which gcc version are you using? gcc-3.3.3. But it's more likely the precompiled libssl. I'm not compiling the openssl thing myself, but just using the standard 0.9.7a version that comes with YDL. Which, btw, causes all of /lib/libcrypto.so.4 /usr/lib/libgssapi_krb5.so.2 /usr/lib/libkrb5.so.3 /lib/libcom_err.so.2 /usr/lib/libk5crypto.so.3 /lib/libresolv.so.2 /lib/libdl.so.2 to also be included. Oh, well. > I get the opposite result on my 2GHz G5: the Mozilla version does > 45MB/s, the openssl version does 135MB/s, and my version does 218MB/s. > The time for a fsck-cache on a linux-2.6 tree (cache hot) is 8.0 > seconds for the Mozilla version, 5.2 seconds for the openssl version, > and 4.4 seconds for my version. I get 16 seconds for the openssl one, and 8 for the Mozilla one. I'll try your version. Linus