Re: Cost of XLogInsert CRC calculations

Mark Cave-Ayland <m.cave-ayland@webbased.co.uk>

From: "Mark Cave-Ayland" <m.cave-ayland@webbased.co.uk>
To: "'Tom Lane'" <tgl@sss.pgh.pa.us>
Cc: "'Manfred Koizar'" <mkoi-pg@aon.at>, "'Greg Stark'" <gsstark@mit.edu>, "'Bruce Momjian'" <pgman@candle.pha.pa.us>, <pgsql-hackers@postgresql.org>
Date: 2005-05-27T14:20:04Z
Lists: pgsql-hackers
> -----Original Message-----
> From: Tom Lane [mailto:tgl@sss.pgh.pa.us] 
> Sent: 27 May 2005 15:00
> To: Mark Cave-Ayland (External)
> Cc: 'Manfred Koizar'; 'Greg Stark'; 'Bruce Momjian'; 
> pgsql-hackers@postgresql.org
> Subject: Re: [HACKERS] Cost of XLogInsert CRC calculations
> 
> 
> "Mark Cave-Ayland" <m.cave-ayland@webbased.co.uk> writes:
> > 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
> 
> Not sure I believe these numbers.  Shouldn't 2x32 be about 
> twice as slow as just one 32-bit CRC?

Well it surprised me, although Manfred's results with VC6 on /MaxSpeed show
a similar margin. The real killer has to be that I wrote a CRC32 routine in
x86 inline assembler (which in comparison to the gcc-produced version stores
the CRC for each iteration in registers instead of in memory as part of the
current frame) which comes in at 6.5s....


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