On Wed, 18 May 2005 01:12:26 -0400, Tom Lane <[EMAIL PROTECTED]> wrote:
>> Wait, par for 32-bit CRCs? Or for 64-bit CRCs calculated using 32-bit ints?
>
>Right, the latter.  We haven't actually tried to measure the cost of
>plain 32bit CRCs... although I seem to recall that when we originally
>decided to use 64bit, someone put up some benchmarks purporting to
>show that there wasn't much difference.

That someone wasn't me (I wasn't around here at that time), but I have
done a few tests today on 32 bit Intel with VC6:

Optimization |  CRC algorithms
Settings     |  32    32a    32b    2x32    64    64a    64b
-------------+-----------------------------------------------
Default      | 7.6    7.6    6.2    8.3    9.1    9.2    9.5
MinSize      | 2.96   2.97   2.97   4.76   6.00   5.98   6.31
MaxSpeed     | 2.92   2.92   2.97   3.13   6.32   6.33   6.22

32a and 32b are functionally equivalent variants of CRC32 where the crc
is a plain uint32, not a struct with just one field.  Same for 64a, 64b,
and 64, respectively.

The most important figure is, that at MaxSpeed (/O2) 2x32 is almost
twice as fast as CRC32 while only being marginally slower than CRC32.

In case anybody wants to repeat my tests or find any flaw therein, the
source is attached.

Servus
 Manfred

Attachment: crctest.tgz
Description: Binary data

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Reply via email to