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

From Mark Cave-Ayland
Subject Re: Cost of XLogInsert CRC calculations
Date
Msg-id 9EB50F1A91413F4FA63019487FCD251D113368@WEBBASEDDC.webbasedltd.local
Whole thread Raw
In response to Re: Cost of XLogInsert CRC calculations  (Manfred Koizar <mkoi-pg@aon.at>)
Responses Re: Cost of XLogInsert CRC calculations  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
> -----Original Message-----
> From: Manfred Koizar [mailto:mkoi-pg@aon.at] 
> Sent: 25 May 2005 20:25
> To: Manfred Koizar
> Cc: Tom Lane; Greg Stark; Bruce Momjian; Mark Cave-Ayland 
> (External); pgsql-hackers@postgresql.org
> Subject: Re: [HACKERS] Cost of XLogInsert CRC calculations

(cut)

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


Hi Manfred,

Sorry about taking a while to respond on this one - the hard drive on my
laptop crashed :(. I repeated your tests on my P4 laptop with gcc 3.2.3 and
reproduced the results below:


Opt    32     32a    32b    2x32   64     64a      64b
--------------------------------------------------------
O1    4.91   4.86   5.43   6.00   11.4   11.39    11.39
O2    4.96   4.94   4.69   5.18   15.86  18.75    24.73
O3    4.82   4.83   4.64   5.18   15.14  13.77    14.73
                          ^^^^^^^^^^^^

So in summary I would say:
- Calculating a CRC64 using 2 x 32 int can be 3 times as fast as
using 1 x 64 int onmy 32-bit Intel laptop with gcc.- The time difference between CRC32 and CRC64 is about 0.5s in the
worse caseshown during testing, so staying with CRC64 would not inflict too
great a penalty.


Kind regards,

Mark.

------------------------
WebBased Ltd
South West Technology Centre
Tamar Science Park
Plymouth
PL6 8BT 

T: +44 (0)1752 797131
F: +44 (0)1752 791023
W: http://www.webbased.co.uk




pgsql-hackers by date:

Previous
From: "Mark Cave-Ayland"
Date:
Subject: Re: Cost of XLogInsert CRC calculations
Next
From: Tom Lane
Date:
Subject: Re: foreign keys and RI triggers