Re: Cost of XLogInsert CRC calculations

From: Simon Riggs <simon(at)2ndquadrant(dot)com>
To: Mark Cave-Ayland <m(dot)cave-ayland(at)webbased(dot)co(dot)uk>
Cc: 'Christopher Kings-Lynne' <chriskl(at)familyhealth(dot)com(dot)au>, 'Tom Lane' <tgl(at)sss(dot)pgh(dot)pa(dot)us>, 'Bruce Momjian' <pgman(at)candle(dot)pha(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Cost of XLogInsert CRC calculations
Date: 2005-05-12 15:52:16
Message-ID: 1115913136.3830.419.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, 2005-05-12 at 13:48 +0100, Mark Cave-Ayland wrote:
> > From: Christopher Kings-Lynne [mailto:chriskl(at)familyhealth(dot)com(dot)au]
> >
> > >>perhaps the CRC-32 routines could be written in in-line assembler
> > >
> > >
> > > If you can do this, step right up. :-)
> > >
> > > Best Regards, Simon Riggs
> >
> > Surely there's an open source code floating around somewhere?
> >

> I've found some x86 MASM sources using Google, but nothing in GCC-style
> in-line assembler. It would be good to see how this compares in terms of
> speed with the code generated by GCC.

Is it BSD? I looked for some other BSD code last month. There was some,
but it was clearly slower than the existing code.

It might be possible to speed things up by a factor of two using a two-
byte lookup table rather than a one byte lookup. This would take up
65536 table entries, which is only 256KB. If we held that in shared
memory we could calculate the entries at startup, or read them in from a
file. It would only use the same space as if we had 255 connections, so
not a great increase in memory usage overall. Need to look at the effect
of retrieving everything from memory rather than from cache, so it
probably wouldn't be twice as fast.

Best Regards, Simon Riggs

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Josh Berkus 2005-05-12 16:57:52 Re: New Contrib Build?
Previous Message Andreas Pflug 2005-05-12 15:49:26 Re: New Contrib Build?