Re: always use runtime checks for CRC-32C instructions - Mailing list pgsql-hackers

From Nathan Bossart
Subject Re: always use runtime checks for CRC-32C instructions
Date
Msg-id 20231031033601.GA68409@nathanxps13
Whole thread Raw
In response to Re: always use runtime checks for CRC-32C instructions  (Jeff Davis <pgsql@j-davis.com>)
Responses Re: always use runtime checks for CRC-32C instructions
List pgsql-hackers
On Mon, Oct 30, 2023 at 01:48:29PM -0700, Jeff Davis wrote:
> I assume you are concerned about the call going through a function
> pointer? If so, is it possible that setting a flag and then branching
> would be better?
> 
> Also, if it's a concern, should we also consider making an inlineable
> version of pg_comp_crc32c_sse42()?

I tested pg_waldump -z with 50M 65-byte records for the following
implementations on an ARM system:

 * slicing-by-8                                : ~3.08s
 * proposed patches applied (runtime check)    : ~2.44s
 * only CRC intrinsics implementation compiled : ~2.42s
 * forced inlining                             : ~2.38s

Avoiding the runtime check produced a 0.8% improvement, and forced inlining
produced another 1.7% improvement.  In comparison, even the runtime check
implementation produced a 20.8% improvement over the slicing-by-8 one.

-- 
Nathan Bossart
Amazon Web Services: https://aws.amazon.com



pgsql-hackers by date:

Previous
From: Richard Guo
Date:
Subject: Re: Not deleted mentions of the cleared path
Next
From: David Rowley
Date:
Subject: Re: small erreport bug over partitioned table pgrowlocks module