Re: Cost of XLogInsert CRC calculations - Mailing list pgsql-hackers

From Manfred Koizar
Subject Re: Cost of XLogInsert CRC calculations
Date
Msg-id aq9m81l2k5br7rahcf9lvc9jj11lbodf09@email.aon.at
Whole thread Raw
In response to Re: Cost of XLogInsert CRC calculations  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Cost of XLogInsert CRC calculations  (Manfred Koizar <mkoi-pg@aon.at>)
List pgsql-hackers
On Wed, 18 May 2005 01:12:26 -0400, Tom Lane <tgl@sss.pgh.pa.us> 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

pgsql-hackers by date:

Previous
From: Kaare Rasmussen
Date:
Subject: Ingres dump files to PostgreSQL
Next
From: Manfred Koizar
Date:
Subject: Re: Bitmap scan cost model (was Re: bitmap scans, btree scans, and tid order)