On Thu, 2009-02-19 at 17:07 -0500, Marc Feeley wrote:
On 19-Feb-09, at 4:57 PM, Marc Feeley wrote:
On my 2GHz Mac Book Pro:
For MD5: 0.06 seconds per MB. For SHA-1: 0.13 seconds per MB.
That's still about 3 times slower than the "md5" utility on my machine, but still not too bad for bit-bashing code entirely written in Scheme.
By the way this slowdown is due to the 16-bit algorithms which are used to perform the computations without overflowing the fixnums. The C version probably does 32-bit operations, which is at least a factor of 2 faster, and probably more when shifts are involved.
And on my 64-bit Core 2 duo running ubuntu it's quite a bit worse:
(time (digest#digest-file "Fedora-12-ppc-DVD.iso" 'sha-1))
(time (digest#digest-file "Fedora-12-ppc-DVD.iso" 'sha-1)) 245908 ms real time 244740 ms cpu time (241710 user, 3030 system) no collections 12312 bytes allocated 8 minor faults no major faults "548e1b544c400d39be4fbd080080424e2b5c7674" heine:~/Desktop/Fedora-12-ppc-DVD> time sha1sum Fedora-12-ppc-DVD.iso 548e1b544c400d39be4fbd080080424e2b5c7674 Fedora-12-ppc-DVD.iso 18.390u 1.670s 2:03.13 16.2% 0+0k 1160296+0io 0pf+0w
Brad