Re: New CRC algorithm: Slicing by 8

From: Jeremy Drake <pgsql(at)jdrake(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Mark Kirkwood <markir(at)paradise(dot)net(dot)nz>, mark(at)mark(dot)mielke(dot)cc, Gurjeet Singh <singh(dot)gurjeet(at)gmail(dot)com>, PGSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: New CRC algorithm: Slicing by 8
Date: 2006-10-23 19:43:40
Message-ID: Pine.BSO.4.64.0610231235490.5201@resin.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, 23 Oct 2006, Tom Lane wrote:

> Hmm. Maybe store the CRCs into a global array somewhere?
>
> uint32 results[NTESTS];
>
> for ...
> {
> INIT/COMP/FIN_CRC32...
> results[j] = mycrc;
> }
>
> This still adds a bit of overhead to the outer loop, but not much.
>

That seems to have worked.

Std crc Slice-8 crc

Intel P4 Xeon 2.8Ghz (Gentoo, gcc-3.4.5, -O2)

8192 bytes 26.765317 10.511143
1024 bytes 3.357843 1.280890
64 bytes 0.223213 0.103767

Intel P4 Xeon 2.8Ghz (Gentoo, icc-9.0.032, -O2 -xN -ipo -parallel)

8192 bytes 29.495836 0.007107
1024 bytes 3.708665 0.012183
64 bytes 0.242579 0.008700

So the gcc times are reasonable, but the icc times for the slice-by-8 are
still too fast to be believed. I will have to take a look at the
generated assembly later and see what gives.

My changed testcrc.c is attached, again.

--
"I'd love to go out with you, but I did my own thing and now I've got
to undo it."

Attachment Content-Type Size
testcrc.c text/plain 874 bytes

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Zdenek Kotala 2006-10-23 19:43:47 COPY does not work with regproc and aclitem
Previous Message Tom Lane 2006-10-23 19:33:52 Re: Tsearch2 index size