Re: What exactly is our CRC algorithm?

From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: Abhijit Menon-Sen <ams(at)2ndQuadrant(dot)com>
Cc: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>, pgsql-hackers(at)postgresql(dot)org, Robert Haas <robertmhaas(at)gmail(dot)com>
Subject: Re: What exactly is our CRC algorithm?
Date: 2014-12-30 17:26:41
Message-ID: 20141230172641.GJ27028@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2014-12-30 21:36:19 +0530, Abhijit Menon-Sen wrote:
> Thanks for spotting that. I had meant to change the test to "& 7". But
> again, now that you mention it, I'm not sure it's necessary. The CRC32*
> instructions don't have the usual SSE alignment requirements, and I see
> that the Linux kernel (among other implementations) process eight bytes
> at a time from the start of the buffer and then process the remaining
> bytes one at a time. I'll do a bit more research and post an update.

I'd done some quick and dirty benchmarking when writing my initial
crc32c POC and I found that four byte aligned accesses were faster than
ones not. But it really just was running it a couple times, nothing more.

Greetings,

Andres Freund

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Janes 2014-12-30 17:45:57 Re: Maximum number of WAL files in the pg_xlog directory
Previous Message Greg Stark 2014-12-30 17:24:18 Re: BUG #12330: ACID is broken for unique constraints