Re: Re: CRC - Mailing list pgsql-hackers

From Bruce Guenter
Subject Re: Re: CRC
Date
Msg-id 20001208160254.D11989@em.ca
Whole thread Raw
In response to Re: Re: CRC  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Fri, Dec 08, 2000 at 04:30:58PM -0500, Tom Lane wrote:
> Bruce Guenter <bruceg@em.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@em.ca>                       http://em.ca/~bruceg/

pgsql-hackers by date:

Previous
From: "Darren King"
Date:
Subject: RE: Hash index on macaddr -> crash
Next
From: Daniele Orlandi
Date:
Subject: European Datestyle