[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: digest algorithm performance
From: |
Jim Meyering |
Subject: |
Re: digest algorithm performance |
Date: |
Tue, 21 Jun 2005 14:53:26 +0200 |
address@hidden wrote:
...
> OK, I'll have a look. FreeBSD seems to be faster again,
> (don't compare these results to the previous mail):
[I've just noticed you used `sha1' below.
Is that a shell alias or function?
The program from coreutils is called sha1sum. ]
> $time sha1 < 15MBfile
> 51e673b839d5bee3293fa2f1dd58c69face9770a
...
> $time openssl sha1 < 15MBfile
> 51e673b839d5bee3293fa2f1dd58c69face9770a
...
FYI, here are a few more data points:
On an AMD-64 system, using a 700MB file on a tmpfs file system
(and enough RAM so that no actual disk reads are performed),
GNU md5sum is slightly faster than `openssl md5', e.g.:
2.38s user 0.38s system 100% cpu 2.756 total (gnu md5sum)
vs.
2.52s user 0.34s system 100% cpu 2.869 total
However, `openssl sha1' is about 5% faster than GNU sha1sum:
3.32s user 0.33s system 99% cpu 3.653 total (openssl sha1)
3.45s user 0.39s system 99% cpu 3.843 total (gnu sha1sum)
The above are using the debian-sid (amd_64 alioth) binaries from
coreutils-5.2.1. When I compile the latest (coreutils-cvs) with
gcc-4.0 -O3, I get slightly (2-3%) better sha1sum performance,
and a ~7% *decrease* in performance for md5sum. I suspect that
with the right compiler options you can do much better.