From: | Bruce Guenter <bruceg(at)em(dot)ca> |
---|---|
To: | pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: Re: CRC |
Date: | 2000-12-08 22:02:54 |
Message-ID: | 20001208160254.D11989@em.ca |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Fri, Dec 08, 2000 at 04:30:58PM -0500, Tom Lane wrote:
> Bruce Guenter <bruceg(at)em(dot)ca> writes:
> >> Are you really saying MD5 was faster than CRC-32?
> > Yes. I expect it's because the operations used in MD5 are easily
> > parallelized, and operate on blocks of 64-bytes at a time, while the CRC
> > is mostly non-parallelizable, uses a table lookup, and operates on
> > single bytes.
> What MD5 implementation did you use?
I used the GPL'ed implementation written by Ulrich Drepper in 1995. The
code from OpenSSL looks identical in terms of the operations performed.
> The one I have handy (the original
> RSA reference version) sure looks like it's more computation per byte
> than a CRC.
The algorithm itself does use more computation per byte. However, the
algorithm works on blocks of 64 bytes at a time. As well, the
operations should be easily pipelined. On the other hand, the CRC code
is largely serial, and highly dependant on a table lookup operation.
--
Bruce Guenter <bruceg(at)em(dot)ca> http://em.ca/~bruceg/
From | Date | Subject | |
---|---|---|---|
Next Message | Daniele Orlandi | 2000-12-08 22:05:30 | European Datestyle |
Previous Message | Darren King | 2000-12-08 21:56:19 | RE: Hash index on macaddr -> crash |