Maybe it depends on your specific hardware, but on linux32 (i3 core2) I
get (kubuntu11-04.iso) :

openssl sha1 : 3.823
fossil sha1sum : 3.660 (old fossil: 4.936)

On linux64 (amd athlon X2, using a 600M data file):
openssl sha1 : 2.504
fossil sha1sum : 3.202 (old fossil: 4.211)

(these are "best times" from a number of runs)

Clearly, the new code is much better than the old code; but it's not
clear the openssl code is always a win... I'm not sure whether or not
it's a good idea to try to determine at run time which to use (since the
check overhead has to be measurable after all).

On 09/01/2011 08:43 PM, Dmitry Chestnykh wrote:
> I noticed the recent effort to optimize SHA-1 in Fossil, and it crossed my 
> mind that we can use OpenSSL implementation (which seem to be heavily 
> optimized), since we already link it when FOSSIL_ENABLE_SSL is defined, and 
> fall back to the current implementation if Fossil is not linked without 
> OpenSSL.
>
> My simple performance test of SHA-1 from checkin [f2ede7da6d] vs OpenSSL 
> shows that the latter is a bit faster:
>
> $ time ./fossil sha1sum ~/Downloads/FreeBSD-8.2-RELEASE-i386-disc1.iso
>
> Current implementation:
>
> real  0m3.549s
> user  0m3.232s
> sys   0m0.315s
>
> OpenSSL implementation:
>
> real  0m3.017s
> user  0m2.699s
> sys   0m0.316s
>
>
> Compiler: i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. 
> build 5658) (LLVM build 2335.15.00)
>
> The diff is very simple -- just a couple of defines; I have attached it.
>
> --
> Dmitry Chestnykh
>
>
>
>
> _______________________________________________
> fossil-users mailing list
> [email protected]
> http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
_______________________________________________
fossil-users mailing list
[email protected]
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

Reply via email to